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.