Railway sources said that the incident occurred late on Sunday night when two wagons of the freight train from Ambala to Rudrapur derailed while changing track after crossing Rampur railway station.
"After getting the information railway officials along with technicians reached the spot and work to remove the derailed coaches was started," they said.
Sources said that train traffic on Delhi- Lucknow route was disrupted and several trains were stopped midway.
The Circle Officer of the Government Railway Police (GRP) said that the reason behind the incident was not clear.