Motorists are warned that the A59 through Starbeck will be closed for three days to allow the subway beneath the level crossing to be replaced.
The ageing subway, kept intact through years of maintenance, will be replaced over the weekend of May 26-29.
The road will be shut from 10pm on Friday, May 26, and is due to reopen at 6am on Tuesday, May 30.
Work to remove the rails, track bed and replace the subway takes place, with no trains able to run between York and Harrogate via Starbeck during that weekend and bus replacement services in operation on each day of May 27-29.
A clearly signposted diversion route will also be in operation for motorists.
Paul Barnfield, regional director at Northern Rail, said: “This is vital work at Starbeck and we have worked closely with Network Rail to keep the disruption to our customers to an absolute minimum.
“Modernisation is happening across the railway in the north of England and the subway works at Starbeck are another example of the investment being committed to projects designed to future proof the network.
Chris Gee, head of operations for Network Rail’s London North Eastern and East Midlands route, said: “We have worked with Northern and the council in planning this work and while there is never a good time to disrupt rail passengers, road users or the nearby community, the work has been planned to keep the disruption to a minimum and we thank all those affected by the closure for their patience.”