DC fast chargers cost something like $70k each. Hydrogen filling stations cost around a million each.
Also, with battery EVs home charging does most of the heavy lifting, you only use fast chargers for long trips. So just a handful of fast chargers on the main roads between cities makes battery EVs viable for a lot of people.
It’s not enough to collect hydrogen, a filling station also needs to compress it to 10,000 PSI to actually get it into a vehicle’s tank. So there’s no home filling for fuel cell EVs, you need a similar footprint to gas stations. Nobody’s interested in spending hundreds of billions of dollars building all those filling stations.