The accident took place near Rura in Kanpur, the official added.
The number of injured has risen to 40 since early morning, the official added.
The coaches of the Ajmer-bound train derailed near Rura, about 50 km from Kanpur around 5.20 a.m.
Of the derailed coaches, 13 were sleeper class, while two were general coaches, the official said.
Senior railway, district and police officials have rushed to the accident site for rescue and relief operations.
Those critically injured were rushed to Akbarpur, the district headquarter of Kanpur (rural).
The others injured were rushed to the Community Health Centre in Rura.
A medical train has been sent from Lucknow to the accident site, a Northern Railway (NR) official told IANS and informed that helpline numbers were also issued in Kanpur, Lucknow and Allahabad.
Two of the coaches fell in a ‘nehar’ (canal), leading to fears of more injuries and even casualties.
Following the accident, routes of at least 12 trains were diverted, North Central railway official Amit Malviya told IANS.
This is for the second time in the last 38 days that a train accident has occurred in Kanpur. The earlier one happened on November 20, leaving more than 150 dead.