"Graham's number" = "an unimaginably large number"
googleplex = 1 with 100 zeroes behind it
Fun fact: there are only 7,125,000,000 people in the world,
while a googleplex is -huge-, an "unimaginably large" number is going to be vastly larger, but ants are as small as a grain of sand it's manageable.
the googleplex of soldiers do not even need flamethrowers for a fraction of that amount of time due to your rules. you state the ants attack from all directions until one group is dead, aka unrelenting.
All the soldiers need is organization and planning. Create a center of operation and build a circular perimeter of active flame thrower wielding soldiers shoulder to shoulder, enough so that if they all fire at once an entire ring of flame comes out from the circles perimeter. perhaps a few rows of soldiers standing at ready to rotate out as reloads/malfunctions occur etc
create shifts so everyone works evenly and no one gets...burned out (lul!)
the ants will be coming non stop, the first waves will require major focus as they swarm in but the flames will literally instantly kill them where they stand upon contact, leaving nothing but a charged body in its place.
New ants will continue pushing the assault, climbing over this corpse. These ants too will feel the wrath of flame and insta-fry
eventually, you will have a very large mount of dead, roasting ants, multiple feet tall. this will effectively create a defensive wall of living embers the ants have to crawl over to attack - which they are constnatly doing as you stated they will not stop - and the moment they climb ontop, they pop.
this burning will be everlasting, because new fuel (ant bodies) will continuously feed the flames. There would be no way in for the ants to attack.
It would probably only take a few hours to develop enough ant charcoal to be self sustained and the flame throwers could then be stored and never used again.