All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The Hadeeth: "Judges are of three types…" is a Saheeh (Authentic) Hadeeth narrated by several scholars of Hadeeth, such as Abu-Daawood, At-Tirmithi, Ibn Maajah and others all, on the authority of Buraydah .
The word “Judge” in this Hadeeth is general, including anyone who judges between two or more people and who has a judgment that is binding. It is more general than the customary judge in court. Accordingly, Sharee‘ah judges are undoubtedly included in this Hadeeth. There is no doubt that they fall under one of the three types of judges who are mentioned in the Hadeeth: "Two judges will be admitted to Hell and one judge will be admitted to Paradise." This is because of the fact that judgeship is an eminent position in Islam that requires full acquaintance with the Book of Allaah, the Sunnah and the rulings that relate to them as well as awareness of current affairs.
As for the judges in courts who judge according to man-made laws, their work is unlawful. It is impermissible for them in the first place to join courts that do not judge according to the Sharee‘ah of Allaah The Almighty. These judges, whether they are fair in their judgments or not, commit an evil and disobey Allaah for their acceptance of man-made laws.
As for policemen, traffic policemen, teachers, and others, they are not judges according to the Sharee‘ah’s technical meaning because traffic policeman do not know the rulings of the Sharee‘ah, whereas the position of a judge is adopted by qualified men.
However, it is permissible for traffic police to judge in traffic accidents by deciding who was right and who was wrong in the accident. The policeman will be rewarded if he intends to be fair, whether he is successful in his judgment or not. Moreover he bears guilt if he is biased towards one of the two parties involved in the accident.
The same ruling applies to the teacher who settles quarrels between students. The teacher is a judge in that regard. If he or she is unfair, the teacher bears guilt and thus is subject to the threat in the Hadeeth. However, he is not a judge in the sense of the Sharee‘ah that was mentioned by scholars.
Allaah Knows best.