Technically, a hydrogen truck is an electrical truck with an undersized battery that is topped up via a hydrogen fuel cell. Fuel cells don't really throttle up or down very well nor do they typically match the peak output of the engines, typically. So you actually need a fairly big battery if you drive into e.g. mountains.

You can trivially improve energy efficiency by just using a bigger battery and getting rid of all expensive and inefficient hydrogen parts. By about 3x. Energy conversion from electricity to hydrogen involves losses, converting it back to electricity adds more losses. And hydrogen is hard to contain and there are losses involved with storing and transporting it as well. Transporting it of course involves using trucks. Which require energy. End to end it doesn't look good. About a 3x difference or worse in terms of energy efficiency.

Producing hydrogen from clean electricity is a lot less efficient than simply dumping that electricity in a battery and using it. And since trucks are designed to haul lots of mass around, have engines with lots of torque, etc. a big battery is much less of a concern. Besides, hydrogen also takes up a lot of space. What it boils down to is the cost of the vehicle and the cost of the fuel (3x). Which is to say that using hydrogen for transport does not make a whole lot of sense.

That's a huge cost advantage for battery electric trucks. And it's the reason that there are multiple manufacturers are already producing those in just about any weight class and form factor you can name. Including some long range heavy trucks, extremely large mining trucks, etc.

The few manufacturers that also peddle hydrogen (Like Nikola) are increasingly focusing on battery electric trucks at this point. But they seem happy taking the subsidies for continuing hydrogen development. That is of course the point; without subsidies most manufacturers would immediately pull the plug on their hydrogen programs. Toyota included. They have very little hope of ever producing vehicles that are cost competitive with battery electric at this point. Certainly not this decade. At best you might argue that electricity will one day be so cheap that the inefficiencies stop mattering. But that's not happening any time soon.

And of course recharging vs. refueling is a popular argument in this space as well. Filling up hydrogen tanks is very unlike fueling a diesel truck. It involves very high pressures and pipes/valves with relatively small diameters. It can easily take twenty minutes or more. During that time you could also dump a lot of electricity in a battery. Besides, truck drivers have mandatory rest periods that are much larger than that. So a 40 minute break is not that big of a deal for a long haul truck driver.

And all of that assumes you'd actually have filling stations that you can use. Those don't exist yet in most places. And probably won't for a long time. Charging stations on the other hand are popping up all over the place.

And there's the slight issue that methane just got a lot more expensive which means that converting it to hydrogen for the purpose of converting it back to electricity is now an even worse idea than it already was. And the main plan for hydrogen producers was to use grey (mostly) and some blue hydrogen for the next few decades. I.e. methane conversion without or with (some) carbon capture. This is bordering on criminally insane from a carbon emissions point of view. The notion of using grey hydrogen for transport for environmental reasons is ludicrous. You'd be using about 6x the equivalent in methane. You are better off using that methane as a fuel directly. Green hydrogen at large scale will require way more wind mills and solar panels to be installed than is needed to electrify fleets using battery electric.