Hit them with a torch, they take a lot of damage from fire.

More Titanomyrma Encountering Tips