There are already far more battery powered electrical trucks than there are hydrogen trucks. That race was over before it ever began. Like with hydrogen cars, the gap is growing very rapidly. All sorts of battery powered trucks exist right now in every weight class. Everything from tiny vans to mining monster trucks. The notion that this cannot work is utter nonsense and easily disproved by just pointing at the obvious reality of these things existing in the market right now.
There are only two limiting factors on electrical trucks: cost of batteries and production volume of battery manufacturers. This is a temporary problem. As the production volumes improve, cost will come down. You can cover any range by just using more batteries. Typical trucks in the market have less than half a mwh of battery. This provides them with a useful but not amazing range. Unlike car owners, truck companies typically settle for good enough and don't suffer from range anxiety. They buy the range they need. Mining trucks need batteries in the mwh range. Batteries are heavy of course but this isn't a problem in a vehicle designed for moving heavy things around.
Australia actually has battery powered road trains weighing hundreds of tonnes. Reason: superior torque over any diesel engine and electricity is very cheap (lots of solar power over there). Some of these vehicles are converted decades old diesel trucks. These aren't high tech vehicles. The process for producing them is brutally simple: rip out the diesel engine, replace that with an electrical motor and shove in pallets of batteries where the fuel tanks used to be. It takes minutes to swap batteries with a fork lift truck. Supremely pragmatic and awesome. If Australians can do this in the middle of nowhere, anyone can. Likewise there are logging trucks in Canada that are built locally for the same reason. Hard core power users of trucks are going for electric. They are just better.
The only thing better than electrical road trains is actual trains on rails. Those too can run on electricity. In fact that's very common and has been so for decades. There are far more electrical trains than diesel trains. High speed trains, freight trains, passenger trains. Long trains, short trains. Any kind of train.
Fuel cells can indeed run on gas. The reason nobody is talking about that or seriously considering this as an alternative is that it is far more lucrative for gas companies to use way more gas to produce hydrogen while grabbing subsidies and selling the hydrogen at premium. Never mind that hydrogen has nearly 3x the volume of gas, both in liquid and compressed form. And never mind the high pressures you need for moving it around in gas form. Because doing so in liquid for is stupidly expensive and technically challenging. In compressed gas form, diesel has about 18x the energy density of hydrogen stored at 200 bar. Meaning you need about 18 trucks of hydrogen for every truck of diesel to move a fleet of trucks around. Transporting hydrogen to fuel stations at scale is stupidly expensive and inefficient. Producing, storing, compressing, pumping, transporting, etc. You lose money and energy at every step. It's stupidly inefficient and costly.
That's why Shell just pulled the plug on this business. It was a scam and these things served their purpose. EVs won. Game over. Moving on to the next thing. Of course the exact same thing is going to happen for hydrogen truck fueling stations. But not until after they pocket the subsidies. Until then they'll be talking up how awesome hydrogen trucks are going to be all while battery electrical trucks are actually being awesome all over the place already.