...Admittedly, Data is also a UFP citizen and a Starfleet officer.
But UFP citizens have significant leeway, often out of cultural reasons: the UFP culture isn't monobloc, and seems to subject different people to different legal obligations and limitations.
And Starfleet officers have even greater leeway, frequently deciding on issues of life and death without consulting their superiors or peers or referring to precedent.
All in all, it would be highly atypical for any of our heroes to hesitate in applying justice or other problem-solving methods on enemies of the UFP, or even on their personal enemies. Apparently, the right for extended self-defense is the only one that applies universally to all UFP species and citizens...