The convoy of pick-up trucks was attacked on Sunday evening in Karukh district of Herat, officials say.
Weapons were stolen by the Taliban from the scene of the attack, the Tolo news agency reported. It said that at least six soldiers had been injured.
The ambush follows fighting last week in the northern province of Kunduz.
Taliban militants in Afghanistan have killed at least 11 Afghan soldiers in an ambush in western Herat province, police have told the BBC.