Five wagons came off the track just before 2am near Church Fenton, meaning no trains are able to run between Church Fenton and Micklefield.
Services between York and Leeds are subject to delays and cancellations this morning.
Nobody was injured in the incident.
Network Rail workers have been on site since the early hours to inspect the damage caused and establish a plan to remove the derailed wagons, repairs the tracks and gets passenger services back to normal as quickly and safely as possible.
The train was delivering new rails to the area when the incident occurred. Before the train can be removed after a derailment, inspectors from the Rail Accident Investigation Branch will have to examine the scene. There is no indication of the cause at this time.
This incident is affecting Northern, CrossCountry, TransPennine Express and LNER services and disruption is expected for at least the rest of the day.
Passengers who need to travel are strongly advised to check their journey via National Rail Enquiries or with their train operator and allow plenty of time. People should continue to follow the latest Government guidance and minimise travel as much as possible.
Network Rail route director Matt Rice said: “I apologise for the disruption passengers are experiencing today as a result of the derailed engineering train at Church Fenton.
“Our teams have been on site since the early hours of the morning and we are working as quickly as we can to safely remove the train, inspect and repair the infrastructure, and get passenger services back to normal. I am grateful for passengers' patience and advise those who need to travel today to check before they do so.”