Diatomaceous earth is one thing that "should" kill or at least drive away the fire ants without harming the earthworms.
Organic Control - Drench with the fire ant control formula - compost tea/molasses/citrus oil. . Many gardeners report good results with instant grits, Malt-o-Meal and other instant break fast cereals. Spraying products that contain molasses helps keep them away. Apply beneficial microorganisms. Laboratory tests have shown that the beneficial fungus Beauveria bassiana is effective against fire ants.
https://www.dirtdoctor.com/Organic-Fire- ... _vq123.htm
None of this should harm the earthworms.
See the rest of this article for more good suggestions.