Around 50 people were also injured in the derailment and are being treated in hospital, Ahmed said.
Rescuers are still working to pull out one person stuck in the debris using two cranes, Ahmed said. They say they can only see the person's hands, so it's not clear if they are dead or alive.
One survivor told CNN affiliate News 18 the train started shaking with "screeching sounds" early Sunday.
"I felt as though metal was clashing with metal, it was like a collision. My upper berth was almost tilted by the time the train halted," Shresth told TV 18.
Shresth -- who used one name as do many people in India -- said he was one of the first to climb out of the wreckage. He was traveling with a friend to the city of Lucknow to attend an event, he said.
When they tried to leave through one of the doors, they found the corridor littered with bodies, he said.
"I did not want to step on the bodies so we took the other door, but by the time we deboarded, all I could see were either dead people or children crying for their parents," Shresth said.
The pair used GPS navigation to make their way to a nearby village hospital. Later they saw ambulances arrive.
Shresth said the accident "shook him for life."
Video from the scene showed mangled carriages flipped over on its side. Fourteen cars in the 23-car train derailed, Modak said. Authorities used cranes and metal cutters to clear the debris.
India's disaster response force spent all day Sunday in what it called a war footing. The army joined rescue operations according to the Press Trust of India.
It was not immediately clear what caused the crash or how many people were traveling on the train, Javeed Ahmed, director general of police for Uttar Pradesh, told CNN News 18.
The government announced aid packages for the families of the bereaved.
Indian Prime Minister Narendra Modi expressed his condolences on Twitter, saying, "My thoughts are with the bereaved families."
Railways Minister Suresh Prabhu told reporters after visiting the site that a high level team will investigate the incident. "Right now the immediate priority is rescue people and to bring relief to those injured and that's what we are doing," Prabhu said.
India's railway system is one of the largest in the world, employing 1.3 million people.
More than 23 million passengers ride them every day on journeys that extend from one end of the country to another. Some passengers spend days on the trains.
Despite being the most popular form of long-distance travel in India, several train accidents are reported each year. This is the deadliest disaster in six years.
India's sprawling rail system is state-run, and the government is being heavily criticized on the nation's television networks. The rail system is known to be poorly maintained, and upgrades have been long overdue. In its last budget, the government put aside large sums of money to modernize the system, to improve traffic lights and lay more rail tracks.