The two divers were forced to jump from the moving train and suffered minor injuries.
The incident happened in the early hours of October 17 2017 just north of Markinch station in Fife.
The train had struck a tree that had fallen across the track. The resulting damage to the underside of the vehicle caused the brakes to be irreversibly released.
Prior to the collision, the train had been water jetting leaf debris from the rails.
The driver saw the tree shortly before impact and applied the emergency brake. The train was travelling at around 40 mph when it hit the tree.
The train continued to slow following the collision, due to the uphill gradient. It came to a rest, but then started to roll backwards.
Having made an emergency call on the train radio, the two train crew jumped from the train onto the trackside and suffered minor injuries.
The train eventually came to a stop on a low point near to Thornton North Junction, after having oscillated up and down the adjacent track gradients several times.
The Rail Accident Investigation Branch is currently probing the incident.