One way is that you give order " GEAR " to the soldier that's out of ammo or running low, and he will go to the nearest place where to get ammo or change gear, like fallen soldier etc. When the soldier gets there, the gearbox/window opens and you can manually select the weapon or ammo he gets.

Thats the way i usually do it, co's if you give him the order to "re-arm at that truck" etc, they always come back empty handed stupid sob's they are