Lots of options , the truck will have a ladder frame unlike a car so can clamp on another external battery (where a trucks long range saddle fuel tanks normally are ) to increase range and then charge overnight , or as pointed out have change over batteries put there .
UPS runs a fixed route , so unlike a private car where one does not know where they are going tomorrow , battery/recharge stations can be installed prior to the trucks operating the route .
Interestingly CRRC the biggest locomotive producer in China is doing a similar project with trams and buses using batteries and super capacitors , so no overhead wires
Personally think short distance trucks are a better fit for battery packs than private cars