But a hydrogen battery has much much better specific energy than lithium ion. So you can have a much longer range.
Hydrogen is very light, so the energy per kilogram is quite high.
However, hydrogen is also naturally not very dense. Hydrogen at 1 atmosphere has a tiny fraction of the energy of a similar volume of batteries. Pressurized hydrogen is similarly dense to a battery, and liquid hydrogen is about twice as dense.
So to make hydrogen dense, you need a very thick, heavy tank to hold the pressurized hydrogen. That significantly cuts into your weight advantages.
Add to that, fuel cells are very inefficient at converting hydrogen to usable electricity.
Maybe I’m missing other conversion factors, but hydrogen has a volumetric energy density of 9MJ/L which is about 2.5kWh/L compared to about 1.7kWh/L for the newest Tesla batteries. So hydrogen is more energy dense than batteries even by volume.