You can load a truck with fuel cells to extend range beyond what the current infrastructure can handle.
It's more complicated with batteries that need to be charged. Sure, there's a grid in many places, but if combat capability depends on the grid, it'll get targetted. And even before that, capacity is a concern and if the grid can handle a tank battalion wanting to plug in every tank so they can be ready for whatever comes next ASAP.
Fuel cells mean they can set up behind the front lines and use power more predictably and refuel tanks quicker than gas.
I never really understood what fuel cells have to do with hydrogen, and why it's a more appealing form factor than removing a vehicle's gas tank and instead just putting in a manifold with room for a number of some standard of gas can with valves fitted. It's not an inherently "hydrogen" thing.
Besides, it's fully possible to set up a bunch of gas cans from a truck in the same way you could set up a bunch of hydrogen "fuel cells".
By my understanding fuel cells are less about form factor, and more about directly converting the fuel into electricity across a membrane, like how batteries operate, so like a battery that takes in Hydrogen on one terminal and Oxygen on the other, being more efficient than burning it in an engine and trying to recapture some of that as electricity after thermal and friction losses have eaten into it.
So it is more a replacement for the engine than it is for the fuel tank.
Wikipedia