It kinda depends to what power density it gets. Trading say 30% range for ability to refill the truck within minutes
might just make enough sense to work. But if, say, electric truck gets enough range to run the full 9 hours (max allowed driving time per day in EU for truck drivers), then it doesn't matter as trucker can do "100% of their work", get to stop and leave it to charge for rest of the day.
For locomotives ? I'd imagine the simplest solution would be to have "battery wagon" ; get on the station, replace the battery wagon, and be on your merry way while it is recharging in the station waiting for next train to pick it up, at least for the long haul stuff. But capacity density still matters, if flow batteries are being close and cheaper then it makes sense, but if you need to pay slighty more per KWh but get 2x the capactity... thats 2x the range and less maintenance.
Or, you know, just electric rail. It already works fine in many places. I wonder if making some hybrid solution with electric rails also being covered by solar panels (basically so same maintenance crew can manage both) would make sense
So it all depends to what level of density it gets. If it is same capacity per kg but lower power there are still many places it can be used, if it is much lower it stops being sensible for moving stuff. And the price would need to be significantly below the normal batteries for anyone to even bother.