I know. But they're wrong.
Here's the issue:
it takes a lot of electricity to separate hydrogen.
Both hydrogen fuel cell electric vehicles (HFCEVs) and battery electric vehicles (BEVs) have an electric motor that provides the motive power. The question is, if we start with 1,000 units of electricity, how much electricity do we wend up with at the electric motor? Since both vehicles require electricity as a feedstock (either directly in the case of a BEV, or indirectly in the case of an HFCEV), where the electricity comes from makes no difference, since it is the same for both types of vehicle. Furthermore, we don't have to consider the efficiency of the electric motor itself, since both types of vehicles use electric motors and the efficiency of the motors will be quite similar.
Let's consider two scenarios: 1) you use 1000 watt-hours of electricity to create hydrogen and put it in a hydrogen fuel cell EV (HFCEV) or 2) you use that same 1000 units of electricity to charge a BEV. How much of that 1,000 watt-hours makes it to the electric motor?
Hydrogen is extracted either by electrolysis from water (less frequently) or from natural gas (most common). This is around 80% efficient. So, neglecting the input stock of water or natural gas, that 1,000 watt-hours of electricity turns into 800 watt-hour equivalents of hydrogen. We then pump this hydrogen into tank of the HFCEV. This process is around 90% efficient (it takes a high pressure pump to fill the tank, so we lose some energy in the process). So now we have .9 * 800 = 720 watt-hour equivalents of hydrogen in the tank. Finally, we use the fuel cell on board the vehicle to convert the hydrogen to electricity at the electric motor. Fuel cells are about 50% efficient. So now our 720 watt-hours becomes 360 watt-hours at the electric motor.
Note that since HFCEVs mostly use hydrogen extracted from natural gas, the process of creating hydrogen emits carbon.
Now consider the BEV. We can take that very same 1,000 watt-hours and charge the vehicle's battery. Battery charging is about 90% efficient. So we now have 900 watt-hours in the battery. We then extract the energy from the battery to the electric motor. That process of extracting from the battery is also about 90% efficient, so we have around 810 watt-hours at the electric motor.
So, in the end the BEV provides 810 watt-hours at the electric motor versus 360 watt-hours at the electric motor for the HFCEV. 810 >> 360.
I completely despise Elon Musk, but he's right on this issue: HFCEVs are dumb. The infrastructure isn't there and would require trillions of dollars to create. In contrast, anywhere we have electricity we can install an electric vehicle charger. For those who say "but we don't have enough energy production for BEVs", well, that's true, but we would need TWICE AS MUCH energy production for a fleet of HFCEVs -- hydrogen doesn't come for free. And, as previously mentioned, the cost to build hydrogen filling stations is prohibitively expensive.
There is one advantage that HFCEVs have over BEVs -- they refuel quicker if you are within range of one of the less than 167 filling stations in the US. That's it for the advantages.