Train defect detector