I suspect that there's another reason that apes lost their tails - most likely related to walking on two feet.
Edit: According to this study (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6417348/), the tailed chap had difficulty/pain when sitting and during other activites
Preserving the gut microbiome through diarrhoea and vomiting.
But it might not be that important at all; do people with an appendectomy struggle more to recover from diarrhea?
Be careful with assuming functionlessness, in general. Evolution does not like spending energy on sticky-out bits that are prone to injury, or good handles for predators to catch, unless they provide some serious advantage.
Balance and navigation (birds, cats, etc) is still somewhat related to the original function in fish.
Sexual attraction/signalling
Grabbing stuff
A third leg in kangaroos
Fly swatter (cows and other large grazers)
For kids to hold onto their parent (elephants)
I'm sure there's a lot of other creative applications of tails that I'm missing.