Two passengers trapped in the bogies were feared dead, Additional Director General of Police (Law and Order) Anand Kumar said. Heavy duty gas cutters were being used to extricate the bodies and all those still trapped in the damaged coaches.
He later put the toll at six and added that four more coaches had derailed. More than 60 people have been injured and rushed to the district hospital in Rae Bareli.
The death toll was expected to rise as several have been critically injured.
Rescue operations were being handled by National Disaster Response Force (NDRF) teams from Allahabad and Varanasi, who were rushed to the scene of the accident, the official added. An NDRF team from Lucknow was expected shortly.
At least 13 trains have been diverted or short terminated following the accident.
Addition Chief Secretary (Information) Avaneesh Awasthi said Chief Minister Yogi Adityanath was apprised of the situation. He has spoken to the district officials and senior police officers.
The authorities have been directed to ensure prompt relief and rescue operations.
Chairman of the Railway Board Ashwani Lohani would be visiting the accident site.
According to the passengers, the train derailed after a loud noise. People from nearby villages were first responders on the accident site.
(With inputs from agencies.)