In the episode Tomorrow is Yesterday, Captain Kirk was considering "disappearing" a man from the twentieth century. One of the factors was that he didn't immediately seem to have contributes significantly to his society.
If the political leader's or military leader's death ultimately made little difference, someone with in their own warring faction simply took their place and the other side
didn't win the war from this one event, then the damage the Commander caused to the planet's society might not have been significant. The leader's "disappearance" would have been of no more importance that Captain Christopher's.
If the Commander acted with malice, say she personally didn't like the leader (was he political or military? Doesn't really matter, just curious.), then her being a contributing cause of his death takes on a different light. Conspiracy to commit murder.
Did the commander have other options to obtain her Captain's release, but she choose this one because it also would give the Commander to personal satisfaction of the leader's death?
There's also the apparent fact the Starfleet, certainly in the TOS era, has a creed of "no man left behind." The Commander's standing orders would include rescuing superior officers.
It's relevant if this all happen during TOS or TNG time periods. During TOS, the Prime Directive was shaped from soft clay. During TNG and later, it was more craved in granite.
There might not be a formal courts martial, a court of inquiry might suffice.