A crash investigation report has praised the driver of a Milton Keynes train which derailed after hitting a landslip caused by heavy rain.
The 6.19am service from Milton Keynes to London came off the rails near Watford on 16 September 2016. The train stayed upright and no-one was injured but it was hit by another train coming in other direction.
The Rail Accident Investigation Branch said "a catastrophic sequence of events" might have been averted because the driver managed to transmit an emergency radio message which alerted the on-coming train and allowed it to slow down.
The report said a London-bound passenger train operated by London Midland struck a landslip at the entrance to Watford slow lines tunnel.
The leading coach of the 8-car train was derailed and it came to a halt in the tunnel about 28 seconds later with the leading coach partly obstructing the opposite track.
About nine seconds later, the derailed train was struck by a passenger train travelling in the opposite direction.
The emergency radio warning meant the driver of the second train had applied the brake reducing the speed of impact.
Both trains were damaged, but there were no serious injuries to passengers or crew.
The crash investigation report said had the first train been derailed only a short distance further to the right the consequences would have been much more severe.
The landslip occurred during a period of exceptionally wet weather.
Water from adjacent land flowed into the cutting close to the tunnel portal and caused soil and rock to wash onto the track.
The site had not been identified by Network Rail as being at risk of a flooding-induced landslip.
Such a landslip had occurred at the same location in 1940, also causing a derailment.
The crash report said rail staff on board the trained reacted well during the incidents.
The Rail Accident Investigation Branch made six recommendations in its report into the crash including four addressed to Network Rail relating to the improvement of drainage, improvement in the identification of locations vulnerable to washout, access by the emergency services, and to expedite a project intended to identify all drainage assets.