The officials said the attackers surprised the soldiers with heavy gunfire yesterday night while patrolling a street in Houta, a town in the southern Lahj province.
The gunmen then set fire to the vehicle, the officials said. They spoke on condition of anonymity because they were not authorized to brief the media.
The identity of the gunmen was not immediately known, but the province has seen increased activity by al-Qaida militants and Shiite Houthi rebels, both of which oppose the government.
The Houthis swept into Sanaa in September and kept President Abed Rabbo Mansour Hadi under house arrest. He fled to the southern city of Aden last week.