Police said that at least eight carriages jumped the tracks near Muzaffarnagar, about 130km (80 miles) north of the capital Delhi.
The cause of the crash, which happened on Saturday evening, is not yet clear.
Rescuers worked into the night to find survivors. TV footage showed carriages piled on top of one another.
The train had been travelling to the Hindu holy city of Haridwar, in the foothills of the Himalayas, from Puri, in eastern Odisha state.
"We are struggling to pull out the injured and are waiting for gas cutters to arrive," said police officer Ajay Pandey at the scene.
"It's too dark to launch a fully fledged search operation but our teams are trying their best."
Indian Prime Minister Narendra Modi tweeted his condolences to families of the victims and pledged all possible assistance.
Train accidents are fairly common in India. The railway system carries more than 22 million passengers a day and much of the equipment is out of date.
An accident in Uttar Pradesh last November killed 150 people and another in the same state a year before killed 39.

The 29-year-old officer, who suffered a leg injury, had been carrying out inquiries in Ness Drive at about 20:30 on Wednesday when the Audi 4 hit him.
The car was later traced and a 38-year-old man was arrested. He is expected to appear at Hamilton Sheriff Court on Friday.
The police officer is in a stable condition in Hairmyres Hospital.

A 9mm self-loading pistol, ammunition, four Enfield pistols and a rifle component were found at Albert Patterson's house in Hereford, the Hereford Times reported.
The 65-year-old was jailed for 15 months at the city's Crown Court.
He had already admitted three firearms offences, possessing prohibited ammunition and possessing ammunition without a certificate.
More on this story and others from Herefordshire
West Mercia Police said Patterson was arrested in January last year and charged in December.
Two charges of possessing a prohibited weapon and a second charge of possessing ammunition without a certificate will remain on file following Wednesday's hearing.
Former SAS soldier Lofty Wiseman who helped train Patterson, described him as a "good lad" who had been naive.
"He broke the law unfortunately. He had to get punished," he said.
"If he wanted a weapon as a keepsake, you could have had it de-activated, but by having a weapon, a serviceable weapon and ammunition, I think it's the ammunition that's really been the nail in the coffin.
"If you have a weapon in a house with ammunition, there's always that temptation... you can never say you're going to use it but different circumstances, state of mind, if it's there, it can be used so that's where you must have laws."
At least 23 people were killed and more than 60 injured when a train derailed in the northern Indian state of Uttar Pradesh.
[NEXT_CONCEPT]
A police officer is being treated in hospital after a car was allegedly driven at him in East Kilbride.
[NEXT_CONCEPT]
A former SAS soldier has been jailed for possessing weapons and ammunition.