The judge refers to someone who will be in charge of deciding certain aspects regarding a case. For example, there is someone who is being charged with a crime in court. The judge, together with the jury, will help decide if the person is guilty or not. A judge would typically need to have years of education and tests before they can reach this position.
Justice is someone who can officiate weddings and other ceremonies but will not have any power to judge people for their actions because he has not undergone any legal training for that. He can witness legal documents, but he does not have any power to make one document more important than the other.
Justice and Revenge are two different words entirely, while the both seek a fair and balanced treatment to be served on someone who was caught to have committed a crime, the path to follow to get this achieved is totally different. Justice is always driven by the urge for fairness but revenge is usually driven by a lot of negative things like jealousy, hatred.
Getting justice for something requires going through a particular process while revenge won't let you think of following due process. Justice has more positive connotation than revenge which is more of a negative way of getting back at people. Whenever it is justice, it is duly served, but if it is revenge, it can be unduly served. Justice is gotten through lawful means, that's why we have different courts of law for people to turn to and get justice but revenge cannot be achieved through lawful means.