Actually revenge is a means of obtaining personal satisfaction, while punishment is meant to teach a lesson. The lines between the two can become blurred but there is a difference. Also by definition revenge is performed by the person that was hurt by the wrongdoing, not a third party seeking justice.
revenge- Inflict hurt or harm on someone for an injury or wrong done to oneself.
So if the justice system keeps everything logical, and doesn't inflict punishment as an act of self satisfaction, it shouldn't be considered revenge.
The bolded part is wrong. I couldn't find a definition anywhere that mentions a "third party".
http://www.thefreedictionary.com
Revenge
To inflict punishment in return for (injury or insult).
Punishment
The act or an instance of punishing. Punish To subject to a penalty for an offense, sin, or fault.
How do you separate revenge and punishment? According to the definition I found of revenge, punishment is involved in revenge. But if you consider revenge as a means to find personal satisfaction, how can a justice system control someones emotion? While they do have different definitions you must also take into consideration that there exists an overlap. If you consider justice as punishing people for their wrong doings, the justice system you described is implausible, as the criminal is being punished in return for hurting others.
Furthermore, not all punishments are meant to teach people something, rather it can simply be to satisfy oneself. While this is true according to the Psychological definition, if you consider execution as a punishment, I ask what is there to learn? The criminal already knows what they are doing is wrong, but by killing them, that isn't teaching them anything new or reinforcing anything. Rather it is depriving them of the chance of understanding the lessons and avoid recommitting the crime.
People can find revenge through punishing those that deserve it and thus, can also find a sense of personal satisfaction. I think that Exilement is correct in his reasoning.
What is more interesting in my opinion is discussing whether revenge can be a form of justice.