The Winchburgh tunnel, in West Lothian, will be closed from June 13 to July 27 as part of the £750 million electrification project, which will fall as many golf fans set out for The Open in St Andrews.
Trains are to be diverted through Dalmeny and journeys are expected take up to 50 per cent longer for some passengers. Services running between Edinburgh, Dunblane and Alloa could also be affected.
Dutch operator Abellio, which won a ten-year contract to run ScotRail from April, pledged to improve signalling to accommodate more trains.
A spokesperson for the Scottish Government said: “We expect ScotRail to develop a timetable that best serves the needs of customers and to accomodate additional demand generated by The Open Championship. Abellio is aware of the proposed blockade works required and in its bid noted the importance of planning for The Open.”