Military ships have Rest and Relation periods. In the US Navy it is not uncommon for sailors to go swimming in friendly waters when they are off duty at a port with warm water. Especially if they don't really get shore leave at this location.
The fanservice angle is simply reflection on the matter that they have women on the ship over the number of one. They'd get Rest and Relaxation too. That the Yamayo/UNCF has standard swimsuits of that type is, well, I don't know what the Japanese do with their defense forces in that area. At least the male suits were just speedo style to balance the female two piece suits just like from the magazine art shown at the start of the series (though I don't recall seeing Yuki in one this espisode).
One thing though: