Hydrogen has a volume problem, though. A 1st generation Toyota Mirai contains 5 kg of H2, equivalent to 197 kWh. That would take up 55 m3 at atmospheric pressure which is why the Mirai stores it at ~700 atmospheres. That's still a 78 liter tank. AFAICT 200 kWh of petrol takes up 25 liters, i.e. a third. On top of that the high-pressure tank in the Mirai weighs 87 kg.
Hydrogen also sucks in that it puts you in your own scaling lane. Relying on batteries means EVs, grid storage, et cetera drive down your costs for “free”.