Ants survive army ants by running away or blocking the door with their heads
Many species flee with their young and rebuild later, while others grow plug-headed workers that seal the tunnels until the swarm leaves.

Kurzgesagt – In a Nutshell · The World War of the Ants – The Army AntWhen army ant scouts appear outside a nest, the smartest defense is not to fight. Army ants are so deadly that other ants had to evolve ways to live alongside them, and fighting back is usually futile.
A common solution is to run. Many species abandon the nest in a frightened rush after spotting scouts. Workers grab as many larvae, the young ants that cannot move on their own, as they can carry and flee the nest. They wait out the raid elsewhere, then come back to restore the nest once the danger has passed.
The second solution is to become the front door. Some species raise a special class of workers with big, square, plug-shaped heads. When raiders arrive, these workers seal the nest openings with their heads.
A blocked entrance leaves the attackers with no way in. After a while, they give up. For ants that cannot outrun such a swarm, a living bunker that simply outwaits the enemy helps the colony survive.
Questions people ask
Why do evacuating ants carry larvae first instead of food?
Larvae are both the colony's future and its most vulnerable members. They cannot move on their own, they are packed with protein, and army ants specifically raid to steal and eat them. Saving food does no good if the next generation is lost.
How does blocking an entrance with a head actually work?
Biologists call it phragmosis, and it works like a cork in a bottle. The soldier's head is flattened and sized to match the nest entrance, so it sits flush with the tunnel wall. Predators cannot get a grip to pull the defender out, and cannot slip past to reach the colony inside.
Why don't army ants just dig around the living doors?
They sometimes try, but time is against them. Army ants are nomadic hunters that depend on overwhelming undefended prey quickly and moving on to the next target. Spending hours chewing through a sealed wall for an uncertain payoff is usually a worse bet than marching on.