I’m not claiming trains are the perfect hijacking target, but they aren’t that bad, either:
1. I doubt you’ll need an army. Chances are most of the passengers will be too scared to even try running away.
2. You probably can afford to lose a few of the most adventurous passengers.
3. In many trains, it isn’t that hard to lock the doors using chain locks you bring in. You can even (partly) do that before your hijack starts.
4. If you don’t start shooting hostages, the police won’t go in for the obvious reason that they want to keep the hostages alive.
From the viewpoint of a terrorist big disadvantage of hijacking a train is that you give up leaving the scene alive and free (airplanes used to have that as a possibility, as you could negotiate for kerosine and fly to a friendly country)