Defect detector is a gadget designed to alert if any vehicle in a train has derailed , or has its brake shoes overheated .