A truck for locally produced food is not usually full nor efficiently packed.
Rather the farmer will grab a little of this, and a little of that. Whatever he can sell the day. This uses far more energy.
And don't forget the energy needed to harvest the food - large growers do it in bulk, small farmers will need to fire up the tractor for short runs.
A cargo ship uses FAR FAR FAR less energy than you might imagine. Even shipping something by rail across the US uses less energy than driving to the next city.
So, it's a truck and a freight train and a ship and a truck for foreign produced food, and only a truck for locally produced food.