That is a HUGE violation of the prime directive.
1) She took sides in a war
2) Her actions resulted in the death of a living being
3) That living being was the leader of a large group in a war time situation
4) her actions involved a political shift.
Now, if the leader was a sonofagun bad guy, I could see it sliding by.
a) How did her crew get captured?
b) How affected by knowledge of the Federation was this culture? Ie: are they a technological civilization or a bunch of barbarians who now worship the ship?
c) Is the point of the novel her getting in trouble?
Obviously there are situational things. If you want to take the novel in the direction of a court scene, then focus on the parts where her actions devastated the other culture. Group B is massacred, Group A is really brutal about it, and the Captain is not pleased. Group B isn't really as bad as they were described by A, and A does all the stuff that B was said to have done.
If you want this to be just a blip, ignore the process.
HOWEVER: I do have to ask: if they're not as technologically powerful as the ship, how come the Commander doesn't just beam her Captain and crew back using the transporter? It's not like they have shields to block them, right? Unless the transporters were destroyed when the Captain was captured...
But yeah, if the crew was being ransomed, she's got a replicator and other resources to trade. ie: trade whatever is needed, get the crew back, then beam back all the gear that was traded for. Done.