The rail line between Kilmarnock and Dumfries is expected to remain closed until Monday, August 17, while engineers work to remove 18 derailed freight wagons and a locomotive from a site near Cumnock in Ayrshire.
To remove the wagons, engineers will first construct an access road to the derailment location and then create an operating pad to site the 1,000tn crane required to lift the vehicles back onto the line.
Work to create the road and bring in the crane will commence on Tuesday, August 4, and has been further complicated by the need to ensure there are no mine-workings located in the area beneath the derailment.
Once on site, the operation to assemble the crane and then remove the derailed wagons and engine will take around 10 days to complete, followed by an estimated three days to repair significant track damage caused by the incident.
David Dickson, infrastructure director for the ScotRail Alliance said: Every effort is being made to recover the line and restore a full service for passengers as quickly as possible.
Our engineers will be working around-the-clock to remove the derailed wagons and repair the damaged track beneath.
This is a very complex operation and we will need to build an access road for a 1,000tn crane, which will then have to be built on site, before we can remove the wagons and repair the track.
"We understand the inconvenience this incident has caused passengers and replacement buses are in operation to serve the stations affected by the recovery works.
The derailment occurred at around 11:20am on Saturday, August 1, when two ballast trains bringing materials into a track renewals worksite collided. No-one was injured as a result of the incident, which is currently under investigation by the Rail Accident Investigation Branch (RAIB).
Due to the incident, train services between Glasgow Central and Carlisle, via Dumfries, are suspended between Kilmarnock and Dumfries, with Auchinleck, New Cumnock, Kirkconnel and Sanquhar stations being served by replacement buses.
ScotRail customers travelling between Glasgow and Carlisle can use their tickets on TransPennine Express and Virgin Trains west coast mainline services.