A rail maintenance company has been fined £400,000 after a worker got trapped between a digger and a station platform in Flintshire.
Lee Woolly was helping to replace a line at Hope Railway Station when the incident happened in March 2013.
He was "fortunate" not to have been killed and was on crutches and off work for six weeks, Mold Crown Court heard.
Babcock Rail Ltd admitted health and safety failings and was also ordered to pay £33,400 costs.
Adrian Farrow, prosecuting, said when the digger-type vehicle was being used on the track it should have moved at walking speed with a controller walking in front of it at all times.
But on the night of the incident, an unplanned movement was made and the vehicle went too fast and no-one was walking ahead of it.
The court heard Mr Woolley saw it approach but was unable to get out of the way and was crushed against the platform.
He was knocked unconscious and suffered bruising to his leg, abdomen and back.
Andrew Longdon, defending, said health and safety was "a priority" for the company and CCTV footage which captured the incident had since been used to train others.
In a statement, the Office of Rail and Road, who brought the prosecution, said: "Babcock Rail's safety management fell below the standards required, as inadequate planning and coordination of track renewals placed workers in unnecessary danger.
"Safety of rail workers is one of the regulator's key priorities and we will take appropriate action against companies or individuals wherever failings are found."