A railway crash that caused a section of line to close for two weeks was caused by a train travelling at 23mph above the speed limit, a report has found.

The crash between a moving and stationary freight train involved 18 wagons and a locomotive derailing at a work site near Logan in East Ayrshire on August 1, 2015.

There were no injuries but the trains and track suffered "substantial" damage and a minor road was blocked by one of the wagons.

The line between Kilmarnock, East Ayrshire, and Dumfries was closed for a fortnight while a crane removed the wreckage from the scene.

An investigation was launched by the Rail Accident Investigation Branch (RAIB), with the results being published on Wednesday.

The report found the immediate cause was that the moving train was travelling at 28mph - too fast to stop when its driver saw the stationary train on the tracks ahead.

It states: "This was due to a combination of the train movement in the work site not taking place at the default speed of 5mph or at caution, as required by railway rules, and the driver of the moving train believing that the stationary train was further away than it actually was.

"An underlying cause was that drivers often do not comply with the rules that require movements within a work site to be made at a speed of no greater than 5mph or at caution."

As a result of the crash, the RAIB has made four recommendations to improve safety for rail services operating within work sites.

Simon French, chief inspector of rail accidents, said: "Collisions between trains within a work site create the potential for very serious harm to those involved, major damage and days of disruption to the travelling public.

"Train movements within work sites and possessions are not regulated by normal railway signalling systems - which is why special care is needed to make sure that trains are always able to stop in the distance that the driver can see to be clear, and that communications between drivers and engineering staff are precise and mutually understood."