I remember long ago when they first started experimenting with H2 ICE’s, they had some mineral they would put into the cylinder that would absorb the H2. The cylinder would take longer to fill, hold more, and would release H2 at a controlled rate, enough to power a vehicle but not enough to explode if punctured, it would simply burn like a lamp.
I think solar panels powering electrolysis as a better alternative than batteries.
BTW: If I remember high school chemistry correctly, H2 is not flammable, it is explosive.