There is a problem unrelated to the ants; that open fissure in the bark is not a good sign, and in the first image, there seems to be some blackening around a previously pruned out branch which may or may not be oozing or leaking, hard to tell because that image is out of focus. This might indicate your tree has canker and is on the way to it becoming bacterial infection.
Unfortunately, the only way to treat canker is to remove infected parts of the tree,but in this case, it seems the problem started in the main trunk quite low down. The fissure does not yet appear to be oozing, but you may need to decide whether to remove the tree at some point if the problem worsens. Further info here https://www.gardenfocused.co.uk/fruitarticles/pest-disease/canker.php