She was in command of the Cayuga in “A Quality of Mercy” as well - it seems that’s her regular gig, and she was assigned Una’s prosecution because…well, that’s how Starfleet rolls, I guess.
I think she was asked by starfleet since she was close, then asked to do jag duty (?!) As a test of her fitness for higher command, which she should have passed.
Maybe the Cayuga performs a support mission? It can do standard starship stuff but also specializes in social work, like diplomacy, legal services, law enforcement, politics, etc
Even if that were the case and the Cayuga is a flying legal-aid clinic it doesn’t make much sense to put the lawyer in charge. You’d have a regular command officer trained to fly spaceships running the ship, and Batel would be like the chief counsel or whatever aboard. But they also did it weird with Crusher too when they made her the captain of a hospital ship. Again, you’d have a ship-captain-type-person flying the thing, and a doctor in charge of the doctoring