While hydrogen fuel cell vehicles might be more efficient than gas/diesel powered vehicles (and generate less carbon dioxide even if you steam reform natural gas to make the hydrogen), their well to wheel efficiency is still considerably lower than battery electric vehicles, which are still lower than powering the vehicle directly (from a catenary). There is likely a point for long distance trains, where the cost of installing catenary is too great and batteries aren't big enough, but that isn't likely the case for commuter or corridor intercity services.
There are two problems with Hydrogen. First of all you need to make the hydrogen gas, either by steam reforming natural gas (which produces CO2) or by electrolysis. Steam reforming is the cheaper of the two, but not only does the process require a significant amount of heat energy as an input, but the chemical energy of the hydrogen gas produced is lower than the chemical energy of the natural gas being transformed, so you might as well just burn the natural gas in the first place. In the end, the process is about 65% efficient. For electrolysis, a modern plant is about 80% efficient.
ref Of course you need a green source of electricity, since a natural gas power plants are only up to 60% efficient.
Secondly you need to use a hydrogen fuel cell to convert that hydrogen back into electricity. Modern fuel cells are only about 60% efficient.
ref If you combine the efficiency of electrolysis with that of a fuel cell, you get an electricity to electricity efficiency of only 48% (ignoring any transmission line loss to get the electricity to the hydrogen production facility or any energy needed to compress the hydrogen for storage). As a comparison, With a catenary, you are looking at an efficiency of more than 90%.
Batteries offer a significantly more efficient process, but have the disadvantage of adding a significant amount of weight. If that weight could be designed into the ballast of the locomotive, then that will help, but there will come a needed range whereby the weight of the battery will become to great, and you end up loosing efficiency due to the need to haul around the extra weight.