That is a HUGE violation of the prime directive.
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?
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.
The species where warp-capable but the war has destroyed all of that technology a very long time ago.
The planet is constantly ravaged by storms and so transporter technology could not cut through it, however both Group A and Group B have a piece of technology that can cut through the interference which Group A offer to the Commander to save her Captain.
a) How did her crew get captured? The Captain and away team were captured as the ascended into the planet via shuttle, to investigate a small island for a certain element. They were shot down by Group B and 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? The culture does not care about the Federation only their own war, they were aware of other beings being out there and so just see the away team as a bargaining chip to get weapons out of the ship to help them defeat Group A
c) Is the point of the novel her getting in trouble? No the point of the story was the capture and how they escaped back to the ship and how the Commander deals with being in command of the ship for the first time. The subsequent Court Martial will be for the way she dealt with the situation