Assailants killed 14 Tunisian soldiers in an attack on two posts near the border with Algeria, where the army has been waging a crackdown on jihadists, the government said Thursday.