For substitutes to be viable, they have to have some combination of these attributes: lower up-front cost, cheaper to use, more convenient, more performant, more reliable, and/or more durable than their competitors, from the point of view of the end user.*
So which of these apply to hydrogen vs battery-electric?
* Or have better network effects, where users directly benefit from other people using the product (not a consideration here), or be advantaged by government decree.
Could you imagine trying to tell someone before the internet that we would run cables across the ocean to digitally connect separate continents? There's a reason the internet started as gov-funded research, and it's precisely because "market forces" are triangulating on the most profitable solution, not necessarily the most efficient one
Not so long ago the same argument was made regarding EVs and charging stations, and hydrogen refueling is far less disruptive than plugging a EV to a socket.