More than 100 were injured. State television, citing transport ministry officials, reported that the crash in northern Egypt was probably caused by a malfunction in one of the trains that brought it to a halt on the rails.
Two trains collided in Egypt's coastal city of Alexandria on Friday killing 42 people and injuring 133 others, a health ministry spokesman said.
The crash at 2:15 p.m. (1215 GMT) near the suburban Khorshid station on the route to Cairo, derailed the engine of one train and two cars of the other, the Egyptian Railway Authority said.
TRT World's Kerry Alexandra has the story.
A railroad switching error was the most likely cause, a security source said without giving further details.
Transport Minister Hisham Arafat said "human error" led to the collision but did not elaborate.
"In order to avoid it, we have to develop the infrastructure," he told state television. A project was under way to improve the area's facilities, but such plans took time and money, he said.
A medical official told state TV some wounded people were still stuck in the trains.
Footage on state television showed dozens of people crowding around the damaged train cars, with bodies strewn on the ground.
A witness said the trains rose into the air "forming a pyramid" as they slammed into each other just outside a suburban station in the Mediterranean port city.
"They rose in the air forming a pyramid when they collided," one witness said. "I started to scream from the rooftops for people to grab some sheets and run."
"The train I was riding was going very quickly," said passenger Moumen Youssef. "I found myself on the floor. When we came out, we found four train cars crushed and a lot of people on the ground."
President Abdel Fattah al-Sisi ordered an inquiry into the crash.
In 2012, 50 people - mostly children - were killed when a train crashed into a school bus south of Cairo, further inflaming public anger at authorities over Egypt's antiquated transport network.