I find myself torn two ways here. One says that there can be no excuse for vigilante actions. If the sentence awarded was deemed inappropriate, then that is a price for democracy that framed the laws, the punishment and appointed the Judges. However, I have already suggested a solution to the question of making punishment fit the crime. This involved a court process as now up to a finding of guilt. The Court would declare that X killed Y. Justification (if such a word is appropriate here) would not enter into it at all. The offender would then be released back into the community and, if public opinion deemed it necessary, friends and relatives of the deceased could act as they felt necessary.
Seeing the results of something akin to my solution, I realise it is not the answer.