At least 37 Hindu pilgrims were killed and several were injured when an express train ploughed into them at a remote railway station in the eastern Indian state of Bihar.

The accident happened at around 9am on Monday when a large group of pilgrims got off a local train at a village railway station on the northern banks of the river Ganges and, oblivious of a fast train heading to the state capital Patna, they began crossing the railway track on their way to a Shiva temple.

The Patna-bound train ploughed through the saffron-robed pilgrims, mostly young men known as kanwariyas, killing several before it ground to a halt.

The death toll is expected to rise.

Enraged pilgrims along with local villagers attacked the express train, injuring the train driver, setting ablaze two coaches, and taking hostage officials of the East Central Railway.

The train was not scheduled to stop at the Dhamara village railway station where the pilgrims had alighted from another passenger train.

A railway spokesperson said on national TV that officials had to seek police help to get to the accident site following the riots.

"Some angry people attacked the train driver and seriously injured him," a police official said. They beat him up mercilessly. Some railway officials are also being held hostage."

Every year in July and August, millions of young men set off on foot in northern India to pay homage to the Hindu god Shiva and bring back holy Ganges water to their hometowns and villages.

Monday morning's train accident is one of the worst involving kanwariyas.