The driver, who was being chased by police, smashed through a railway barrier and jumped out of the decommissioned ambulance, which then came within inches of colliding with an oncoming train.
Shane Hughes, 41, from Halifax, led officers on a chase for 37 miles before abandoning the vehicle on the railway tracks at Kildwick, North Yorkshire, on July 13.
The video, shot on the dash-cam of a police car, shows Hughes tearing the wrong way around a roundabout as he is followed by police.
After crashing through a barrier and stopping on the railway line, he is seen running away from his vehicle as a train rapidly approaches at 70mph.
Officers frantically wave to try to warn the train driver of the danger ahead as the locomotive thunders past blasting its horn, narrowly missing the getaway vehicle.
Hughes was yesterday jailed for 22 months and banned for driving for six years and 11 months.
A judge at Bradford Crown Court said it was the worst case of dangerous driving he had ever seen.
He pleaded guilty to a number of driving offences and a charge of theft.
After sentencing, Traffic Constable Gemma Brett, of the Major Collision Investigation Unit who led the case for North Yorkshire Police, said: “On the day of these offences, Shane Hughes put numerous lives at risk and could have caused untold carnage.
“His actions were totally irresponsible, illegal and focused entirely on himself with no thought whatsoever for the safety of anyone else.
“The sentence handed to him today shows that the courts, as well as the police, are determined to keep North Yorkshire’s communities safe by getting offenders like Hughes off our roads.”