The magistrate realizes that he can no longer simply ignore the horrific happenings around him. He learns that it is time to speak up when he feels that an injustice is being enacted. As a consequence, he ends up being tortured. But he does come to the realization that staying silent is the best way to let the apathy and inhumanity continue. By speaking up, he is showing the torturers the extent of the pain they are causing.
The magistrate also learns that his loyalty to the Empire is based on an incomplete knowledge of its inner workings and motivations. When he sees the injustices being committed by the Empire and its subordinates, he realizes that he cannot distance himself from the empire as he and the Colonel are "two sides of the same coin." While I felt that at this point he had reached a new level of realization about his reality, I cannot say that I felt he had really and truly changed by the end of the novel. A part of him still wishes that he were living in ignorance of the Empire's injustices.