Answer: Ordinarily I would suggest bare rooting and repotting the plant into fresh soil but this is not the right time of year to repot a cactus; another suggestion would be to sink the pot in water up to its rim and flood them out, but that is not suitable for a cactus, either.
You might be able to bait and kill the ants using boric acid powder. Mix a bit of boric acid into a little dab of peanut butter and a bit of boric acid into a little dab of jelly or honey. Put the dabs inside an empty, rinsed, soda can or similar container and lay it on its side on top of or next to the cactus pot, in a spot where the ants would find it. Depending on what kind of ants these are, they should be attracted to either the protein in the peanut butter or to the sugar in the jelly. They will carry the boric acid back to the nest in the pot, ingest it and die out.
The reason for using the soda can is to keep the boric acid away from pets or small children. If that is not a concern, dab onto a bit of wax paper or whatever and place it on the soil surface or next to the pot -- where you are seeing most of the ants.
If that does not work within a day or two, you might try contacting your local county extension to see what they suggest for use on an indoor plant. Good luck!
Q&A Library Searching Tips