^ Thompson was a Starfleet officer, and a citizen of the Federation. Either will do.
Rajan was not a member of Starfleet not the Federation. Therefore, he was not subject to their authority. Likewise, he was not viewed as a criminal, enemy combatant or prisoner by the end of the episode.
Rajan was no different than some foreign operative wiki is returned to his home government after killing a soldier or US personnel.
Well they were within Federation territory and as such subject to Federation Law.
When you visit another country you are subject to their laws, it is up to the local authorities to decide upon what course of action to take should you break any laws.
We're not talking about you and me. We're talking about a representative of a foreign government with whom the UFP has no treaty or extradition agreement.
This would be similar to a Soviet, North Korean or a soldier or diplomat from some other enemy state coming to the US and killing a US soldier. In hopes of opening or preserving diplomatic relations, that diplomat or soldier is returned to the enemy state and not sent to Club Gitmo.
At the end of every spy show or covert ops show, are the bad guys ever prosecuted for the security guards, police, soldiers or spies they kill during the course of the show?