Flames roared through the carriages as the train approached the town of Liaquatpur in Punjab, in the latest tragedy to hit the country's dilapidated, poorly maintained and mismanaged rail system.
Deputy commissioner Jamil Ahmed said the death toll had risen steadily since the early morning, after the fire broke out when a gas stove exploded as breakfast was being prepared on board.
Prime minister Imran Khan expressed deep sorrow over the "terrible tragedy", offering condolences to the families of the victims and praying for the speedy recovery of the injured.
He also ordered an urgent investigation into the incident.
Survivors recounted horrific scenes of fellow passengers screaming as they jumped through the windows and off the train, flames billowing from the carriages.
"We could hear people crying and screaming for help," said Chaudhry Shujaat, who had boarded the train with his wife and two children. "I thought we would die. The next car was on fire.
"We felt so helpless."
Ghulam Abbas, a passenger who had got on the train in the town of Nawabshah in neighbouring Sindh province with his wife and two children, recounted watching panicked passengers in his carriage jumping off.
"We learned after that most of them had died," he said, adding that it was nearly 20 minutes before the train stopped.
His wife, Sulai Khan Bibi, said she was horrified about what would happen to their two small children. "We were so close to death, but Allah saved us," she said, clutching the children.
Poor passengers often bring their own small gas stoves on the trains to cook their meals, despite rules to the contrary, according to railways minister Sheikh Rashid Ahmed. Safety regulations are often ignored in the overcrowded trains.
Mr Ahmed said cooking oil carried on the train by Islamic missionaries known as Tableeqi-e-Jamaat had caught fire after the initial cooking stove exploded, contributing to the blaze.
Railway official Shabir Ahmed said bodies of passengers were scattered over a wide area around the site.
People from nearby villages rushed to the train, carrying buckets of water and shovels to help douse the flames. "But it was impossible," said Ahmed.
Through the morning hours, rescue workers and inspectors sifted through the charred wreckage, looking for survivors and aiding the injured.
Local TV footage from the scene showed a huge blaze raging as firefighters struggled to get it under control.
Officials said they were still trying to identify the victims and that the lists of fatalities and those injured were not ready yet. Another train was dispatched to take the survivors to the city of Rawalpindi, they said.
Yasmin Rashid, a provincial minister in the Punjab, told reporters that medical staff were providing the best possible treatment for the injured at a hospital in Liaquatpur. Those critically injured were taken by ambulance to the city of Multan.
The train was on its way from the southern port city of Karachi, the capital of southern Sindh province, to the garrison city of Rawalpindi when the blaze erupted, said Mr Ahmed.
Pakistan's military said troops were also participating in the rescue operation.