It’s impressive to see Javert in his element, being every bit the protector he thinks he is. Most of the time we see him persecuting people who don’t deserve it.
Interrupting the ambush shows us that he’s an antagonist rather than a simple villain. More to the point, the way Javert interrupts the ambush is what shows it: A dramatic entrance, clever quips, bravery in the face of danger, pausing to start his report while his deputies cuff everyone, and he’s going against actual criminals. For this one scene, he’s portrayed heroically.
This is how Javert sees himself: the vigilant protector of society.
But he’s only heroic in this instance because he’s in the right. He doesn’t understand that he can be, and often is, on the wrong side, because he values authority and order more than people.
Anyway: I’m done with part three after 3½ months of weekday lunch hours. The biggest difference I’ve noticed between this time through and the last is that I’m looking ahead when making connections, not just back. Last time I’d forgotten a lot of the structure and story that wasn’t in the musical. This time it’s only been five years, so I remember a lot more.