A judge is a figure of authority, one who interprets the laws of a culture and often sentences those who have been found guilty of breaking the laws. Judges usually preside over a court in which they exercise their authority.
The exact role of the judge varies across cultures. In Cardassian society, the role of judge is filled by the Chief Archon. (DS9: "Tribunal") In most Federation societies judges have filled important roles throughout history and many judges, such as T'Pau and Aaron Satie, are revered figures in their cultures. (VOY: "Darkling"; TNG: "The Drumhead")
Someone who acts as an arbiter in contests, using their own judgment to subjective qualities to determine the winner, is also called a judge. Emony Dax was a judge in several gymnastics competitions. (DS9: "Trials and Tribble-ations")