Last mile delivery can be done with large cargo ebikes capable of carrying up to 250-500kg.
Trucks or delivery vans should only be allowed on roads farther apart than 1-2km, with some exceptions (supermarkets, regular markets, etc).
We have all the technical tools needed, this is about political will.