Hydrogen-powered vehicles are much, much lighter than battery-driven, so consume less energy in operation. Balanced against that, electrolysing hydrogen has some losses, and braking doesn't regenerate hydrogen you used.
«In 2016, studies found that the cost of a typical EV battery replacement could reach $10,000 or more» (from Autoweek).
Probably future decreases will come from better power density, requiring less physical material for a given capacity, as demand for materials soars. It is remarkable how little lithium there is in a typical Tesla.
A decade later, replacement pack for that car still runs you ~$20k, which makes model S cars disposable when they roll off the subsidized warranty.
What Tesla charges to replace batteries is a whole other matter. They charge what they think they can get.
Storing it as a comnpressed gas just plain sucks. (Ask NASA and Boeing about that.)
It's not even slightly viable unless you get the sweet Toyota $15k credit for hydrogen.
In my country there are exactly 0 hydrogen refuelling stations, I'd need to grab my passport to go refuel =) There are 4 L3 quick chargers 5 minutes away. 4 more 10 minutes away. And I can charge where I park.
Nowadays it mostly seems to be people who, for some reason, hate battery electric vehicles and are pointing at the "coming soon" hydrogen vehicles as a reason why they still use an ICE.
Even though a hydrogen powered vehicle IS an EV except that ~80% of the battery is replaced with hydrogen tanks and a fuel cell...
(Yes, Toyota has a prototype car that can run on straight-up hydrogen for like 10 miles at a time)