“Energy density” generally refers to the volumetric energy density, where hydrogen is one of the worse methods of storing energy. Hydrogen has the best “specific energy density” or gravimetric energy density, IF it is compressed. You should include both if you want to be accurate.
This is why hydrogen has lost when it comes to cars. Hydrogen has pretty bad energy density to start with, and then you’ve got to store it in cylindrical tanks which is hard to integrate efficiently, and can’t easily be made into a structural member of the car itself.
As a “battery” (with fuel cells) , it also doesn’t have great power density. Power comes for free when adding batteries. Every battery added improves power capacity. Not so with hydrogen. You need to add both hydrogen and more fuel cells to get more power. That’s why BEVs is also doing well for racing cars and hyper cars (see pikes peak race for instance)
In places where volume and power isn’t important, hydrogen could be promising. Trucks and ships are obvious candidates.
First major non-fossil-driven producer of ammonia is under construction in Norway. Another 300 that size will be enough for current world market, but ships will need another 300.
You can make hydrogen tanks a structural member. They're made out of carbon fiber after all.
Modern fuel cells have extremely high power density. You can easily have >300hp in a car. Even higher for large vehicles.
Hydrogen could easily replace batteries in nearly everything. In fact hydrogen cars already have more (real-world) range and 5 minute refueling. You have to get down to laptops and cellphones before the complexity problems makes hydrogen less desirable. People are just deluding themselves by saying hydrogen can't make sense in cars.