Is it plausible for a species of ant that inhabits a mangrove-like marine environment to have their abdomen evolve into a tail-like appendage for swimming to move from tree to tree to forage?
You want bubble bees.
There exist aquatic hymenopterans! I had never heard of them until I read for this question so thank you! Hymenoptera is the order to which ants as well as bees and wasps belong.
All aquatic Hymenoptera are parasitoids. Many species have relatively dense pubescence to trap air and elongate, tarsal claws to grip the substrate, when underwater. Most species are known from the Holarctic and Oriental regions, but this is likely an artefact caused by lack of knowledge of other regions of the world. Aquatic behaviour has evolved independently at least 50 times within the order.
Dense pubescence means they are hairy, which is the method diving spiders use to carry a bubble of air around with them. Bees are plenty hairy already and I bet they could pull this off. Breathing thru a tail snorkel is done by rat-tailed maggots which are fly larvae so if you really wanted to do that you could have your bees with rat tails. But the maggots are not super mobile I do not think - mobile things like spiders, wasps, beetles and your bees will probably just surface to recharge the bubble.
I found this video of Prestwichia aquatica and I think I can see the bubbles trapped under the wing.
For such a cool animal I was surprised to find nothing on the pop biology sites! Even the Wikipedia article is translated from the Russian. National Geographic if you are watching, aquatic wasps would be a fine topic.
No evolution needed, in the Ants View of the World an individual can be sacrificed and used as part of a bridge. Clusters of ants bridge over or float over, get on a clump of mangrove, and strip it bare. When no more resources on the dry, they start extending out. Tides, winds, fish splashing, etc. break off clumps that then float a few more feet and hit another clump of mangrove, or perhaps a bridge out exploring gets lucky. Plenty of youtube vids of clumps of ants floating, forming bridges across small spans of still water, etc.