This is not a question of which one is accurate as both of the prepositions "by/on" can be used after the verb "judge".
When you say "judging by his appearance (or clothes)", by means:
Identifying the agent performing an action:
Therefore, it can be interpreted as "his appearance has worked as an agent to help you judge his job, age and character, etc." In other words, without his appearance, your judgement will not be likely nor feasible.
Using "on" is similar in a sense that without exam results, your judgement will not be likely nor feasible. But the difference is, when you say "schools should not be judged only on exam results, on means:
Having (the thing mentioned) as a basis:
Therefore, the object of "on" can be more concrete and quantifiable data such as exam results. "Exam results" are quite different from "appearance" as the former can be expressed "in quantity" while the latter can't.
[Oxford Online Dictionary]