The Philippine military says ISIL-inspired fighters in the southern city of Marawi are nearly defeated.