Two passenger trains derailed minutes apart on flooded tracks on a bridge in central India, killing at least 24 people while more than 300 have been rescued, officials said Wednesday.

The Kamayani Express was on its way to Mumbai when it derailed late Tuesday night near the town of Harda in Madhya Pradesh state, while the Janata Express was traveling in the opposite direction when it derailed soon after.

The trains were crossing a small bridge near the rain-swollen Machak River, about 950 kilometers (590 miles) south of New Delhi. Another train had passed the same culvert 10 minutes before the first derailment without any problem, but then a flash flood caused part of the track to sink into the rain-soaked ground, said A.K. Mittal, a senior railway officer.

Six coaches from the Kamayani Express and the engine and four coaches from the Janata Express derailed. The accident occurred just before midnight, and although rescue workers soon reached the site, they were slowed by darkness.

At least two coaches were partially submerged in the mud, said railway official Anil Saksena. While most people had been pulled to safety, rescue workers were still searching for passengers likely trapped.

"We are getting reports that there were flash floods and the tracks caved in. Most of the coaches had passed but the last few carriages were derailed," Saksena said.

At least 24 bodies have been recovered so far and one person was seriously injured, said Bijendra Kumar, a railway official in Bhopal, the main city in Madhya Pradesh state.

Junior Home Minister Kiren Rijiju said more than 300 people have been rescued. By Wednesday morning, the unaffected coaches had been moved from the tracks and rescue operations were nearing a close, according to Kumar. He said that railway workers would soon start repairing the tracks so traffic can resume. Dozens of trains have been blocked from moving due to the accident, while others have been diverted to other routes.

Prime Minister Narendra Modi tweeted: "The two train accidents in Madhya Pradesh are deeply distressing. Deeply pained over the loss of lives."

Heavy monsoon rains have killed more than 100 people in western and eastern India in the past week, flooding rivers and fields, and forcing tens of thousands to take shelter in state-run relief camps.

The rain eased Wednesday following two days of heavy downpour.

India has one of the world's largest railway networks and carries more than 23 million passengers each day. However, many parts of the vast network are poorly maintained and accidents are common. Earlier this year, Modi's government had announced plans for a $137 billion overhaul of the railway's crumbling infrastructure over the next five years.

While many trains are called express, they rarely travel faster than 50 kilometers (30 miles) an hour. The extensive train network remains the main means of transportation for people and goods.