Your hydrogen tank is going to be bigger, heavier, and less practical (It's basically a bomb) than a battery that gives the same amount of energy. Producing the hydrogen requires significant power, so it's not even better for the environment unless your energy comes from a clean source.
I suppose there's the benefit that you can refill it quickly just like with gasoline, but you'd have to build out an entire new distribution system. At least with batteries, you just have to connect to the existing power grid.
Because this application is limited to commercial traffic, we don't need to worry about an expansive hydrogen distribution network like we would have to do with non-commercial vehicles. Also, Toyota's hydrogen pumps are designed to fill at the rate of diesel - so the trucks can be easily refilled.
The bottom line is I don't think this is an either/or decision. I think there are some applications for which hydrogen makes more sense, and there are some applications for which EV makes more sense.
You don't have to carry 2 tons with you everytime.
https://en.wikipedia.org/wiki/Dimethyl_ether
I used to think that making e-fuels off concentrated CO2 sources from industrial sources made no sense but it could make the economics of the fuel synthesizer a lot better though it doesn't mix with the idea that the fuel synthesizer runs only when cheap energy is available.