Liquid hydrogen takes up a lot more room than kerosene. The insulated liquid-hydrogen tank is quite a lot bigger than the kerosene tank -- maybe it is a whole other car -- but so what? Room on a train is cheap. What matters is weight. The tank is light, and the weight of LH2 needed to go the same distance is much less. The difference is weight that doesn't itself need to be transported.
Furthermore, the LH2 can be produced and banked on-site at the railyard, and during peak-production hours, so cheaply.
So, a win all around. Not as big a win as LH2-powered aircraft, but better, and much easier to retrofit.