The invention provides a steel rail ultrasonic on-line detection system and a control method thereof. The steel rail ultrasonic on-line detection system comprises a support, a roller way, a railhead tread undercarriage, a rail base undercarriage, a railhead right undercarriage, a railhead left undercarriage, a rail web left undercarriage, ultrasonic probes, a photoelectric correlated cell I, a photoelectric correlated cell II, a photoelectric correlated cell III, a photoelectric correlated cell IV, a steel rail position detection device, a steel rail shape detection device, a controller and an ultrasonic tester. When the photoelectric correlated cells induct a steel rail, the controller controls the corresponding undercarriage to lift or drop so that the ultrasonic probe on the corresponding undercarriage is driven to act and thus flaw detection on all parts of the steel rail is realized. When an internal defect of a steel rail is found, the steel rail position detection device outputs a specific position of the internal defect of the steel rail and flaw detection is stopped. The steel rail ultrasonic on-line detection system has the advantages of wide detection range, fast detection rate and high detection precision.