Two train coaches which rolled into closed level crossing gates during a shunting operation were "not properly secured", a safety report has found.
The incident happened on 25 Jul 2018 at Bitton Station on the Avon Valley Railway, which is crossed by the Bristol to Bath bike and foot path.
The Rail Accident Investigations Branch (RAIB) said it "demonstrated the importance of proper securing of stabled vehicles".
Nobody was hurt in the incident.
The two empty carriages "ran away for approximately 40 metres (131 feet) along the platform, down a gradient, towards a gated cycle and footpath crossing", the report said.
The RAIB said the railway path was busy at the time, and said CCTV evidence showed two cyclists and one pedestrian passed over the level crossing in the 20 seconds before the coaches struck the gate.
The coaches had not been properly secured after being uncoupled from a locomotive as the first part of a shunting operation to re-form the train for the following day's operations.
Author unknown.