As a switcher locomotive in a yard, the economics change from the long haul and short haul locomotives. Since it will always be working in one facility, the likely short refueling intervals are not so big a deal. If the thing is using regenerative braking to recover H2 from the water, then there is potentially quite a large cost savings. Adding in the reduction in diesel exhaust, quieter operation, and sales of the carbon credits, may even balance out the increased cost of the locomotive and fueling facility.
Assuming the cost per BTU of the hydrogen is reasonably close to the cost per BTU of deisel fuel
As to wiring codes that would apply. I don't have a book handy, but I think there is a chapter on industrial locations with flammable and cryogenic gases.
Hazards are the fire and explosive nature of hydrogen gas in air, so explosion-proof fittings for all wiring and enclosures. Hydrogen is lighter than air, so venting the top of any conduit to release the vapors would make sense to me.
There is also the hazards of cryogenic liquids, assuming the hydrogen is dispensed as LH2, so heavy duty conduit down at ground level and underneath any tanks, pumps or pipes with the stuff, and venting to allow pressure buildups to safely release from inside conduit and enclosures that got LH2 inside of them.
Anti-static precaustions like they use at fuel tanker filling stations and airplane fueling stations.
I can't think of anything else off the top. Isn't it always fun to be the first?