The accident took place late last night between Kasta and Paraiya stations under Gaya-Mughalsarai section of the East Central Railway, the police said.
Rail traffic was disrupted in the section since midnight last night as cranes were engaged to remove the affected bogies, railway sources said.
Passengers were taken to Mughalsarai by a rescue train from where a special train was arranged to send them to New Delhi, they said.
The explosive planted in the tracks between Kasta and Paraiya stations went off shortly after the train left Gaya station, district Superintendent of Police Sushil Khopde said, adding, a medical team with rescue train was sent to the spot.