All perfect praise be to Allah, The Lord of The Worlds and may His Peace and Blessings be upon our Prophet Muhammad and upon all f his family and companions.
If a Muslim kills ants while he is in state of Ihram, it doesn`t invalidate his Hajj or Umrah, and no expiation is due on him.
An-Nawawi (May Allah have mercy on him) said: "Ash-Shaffi disliked killing ants, but he used to say that nothing is due on a Muslim who has done so while in state of Ihram." {Al-Majmou`, vol.7/pp.334}.
In fact, it is prohibited for a Muslim to kill harmless ants, whether he was in state of Ihram or not, because of the Hadith narrated by Ibn Abbas, and reads as follows: "The Prophet (PBUH) prohibited to kill four creatures: ants, bees, hoopoes, and sparrow-hawks." {Related by Abu Dawood}. And Allah knows best.