The accident happened between Mundapandey and Rampur railway stations, Northern railway spokesperson Neeraj Sharma said.
He said while two passengers have been injured there was no casualty in the accident.
Moradabad Divisional Railway Manager (DRM) has reached the spot to oversee the rescue and relief operations. A medical team has also reached the spot, he said.
The official said causes of the accidents are not known yet.
Earlier, police officials in Rampur had said 15 passengers were injured and rushed to hospital.