The disadvantage of H2 fuel cell trains is that they are often less efficient than electric batteries. Both are environmentally friendly at the train. As pointed out, either can be good or bad environmentally overall, depending on how the electricity or hydrogen is made and distributed. The fuel cell is more efficient than a diesel at the train and can be lighter than a pure battery train (the fuel cell train will have some batteries).
Hydrogen works best with a nearby source of cheap and clean electricity. Wind and hydroelectric power are good examples. There are a number of H2 fuel cell trains that have recently entered service or are on ordered. Fuel cell cars have used high pressure H2 storage for a while without any significant safety problems.
The details of the service often determine the economics. If you are running under catenary with modest lengths of non-electrified track, you can charge batteries under the catenary. The train ends up being catenary plus battery. If your in the mountains with nearby hydroelectric, then fuel cells may be the answer, if catenary isn’t an option.
I could go on forever, but search for Hydrail, iLint train, etc. to find out more. Please remember that many people either have a vested interest in one solution or that some evaluations are more about theory than practice.
Take care.