Network Rail is scheduled to start work on installing a pump to prevent a flooding problem on Euxton Lane in Chorley on Monday 26 September.
Highways engineers from Lancashire County Council have often had to close Euxton Lane since September last year, when a drain owned by Network Rail on nearby land collapsed, causing surface water to flood the road after significant rainfall.
The pump will operate automatically to prevent the road becoming impassable when it rains.
The county council said residents will experience some further inconvenience in the short term as Euxton Lane needs to be closed until Friday 7 October to allow the work to take place.
The county council added that a signed diversion will be put in place with School Lane and Pear Tree Lane designated access-only to keep disruption to a minimum.
Jo Kaye, Network Rail route director, said: "This has been a particularly difficult problem because of the location of the drain, which is buried deep below the busy London to Scotland main line.
"However, I am pleased that we have a solution and that the new pump will be working before the winter weather sets in."
The signed diversion will direct traffic via A49 Wigan Road, Balshaw Lane, Westway and Euxton Lane.
The county council said Network Rail initially explored options for repairing the original drain which collapsed. However, it added that exploration work was time consuming and technically difficult due to the drain's depth, length, age and location close to the West Coast Main Line.
The work revealed further problems with the drain and led to the decision to explore the option of installing an automatic pump rather than attempt to fix the collapsed sections with the risk the problem could reoccur.
Highways engineers recently installed a CCTV camera on a lamppost in Euxton Lane so they could monitor the road and react as quickly as possible to pump away water whenever flooding occurred.