It might have been a violation of the Prime Directive, but it may have been waived/disregarded in this situation
We know from several (especially TNG) episodes that the Prime Directive includes a general non-interference policy. Therefore, Starfleet cannot interfere in internal affairs of other (even warp-capable) civilizations. We do not know how does the Prime Directive deals with dual-citizenship of its officers, as this varies from episode to episode.
Being formally a violation or not, Worf was under orders to interfere:
WORF: It would not be the first time that a Klingon Chancellor put his
own interests ahead of the greater good.
SISKO: Something has to be
done.
WORF: Agreed. And I do have a solution. But it will not be
easy.
SISKO: Do whatever it takes, Mister Worf. Those Klingon ships
out there are the only thing between us and the Breen. Gowron is
risking the safety of the entire Alpha Quadrant and he has to stop.
WORF: Understood.
Although it was not an explicit order to kill Gowron, it can be assumed, especially after the events of In the Pale Moonlight, that Worf was given a free hand in this matter. He tried to persuade Martok to challenge Gowron, and even tried to talk to Gowron during the meeting. As there was no one to challenge him or to change his mind, he has taken the matter in his own hands. He challenged Gowron as a Klingon, and not as a Starfleet officer (which has been recognized at least by Gowron and himself).
GOWRON: I should have known better than to trust you again. If you
were a true Klingon, I would kill you where you stand. Fortunately for
you, that child's uniform shields you from your rightful fate. (Worf
takes off his comm. badge.)
WORF: What I say now, I say as a member of the House of Martok, not a
Starfleet officer. You have dishonoured yourself and the Empire and
you are not worthy to lead the Council.
GOWRON: There can be only one answer to that. (Gowron throws his
cloak on the table, and the pair take bat'leths from the wall
displays.)
We do not have any knowledge or reprimands or other punishment that was given to Worf after these events, and if they were, I believe they would have been referenced in the next episodes, as it was an important matter. Therefore, I believe that Starfleet has not considered it a violation of the Prime Directive.