Militants inflicted heavy losses on Benin's armed forces during an attack this week on a fortified military post in the north of the country, the military said in a statement.