Optimizing Ultrasonic Rail Defect Inspection to Improve Transportation Safety and Efficiency