Javert being very human, if to be human is to be inherently flawed (okay, I'm speaking in trite cliches this evening - I'm a bit knackered! So Captain Obvious is setting forth yet again). Javert is an instrument of the law, but humans are, by their very nature, flawed...therefore how can the system be perfect? The law, as personified by Javert, was as indifferent as most society was to Fantine's plight, and even a man who is a passionate upholder of justice failed to deal justly with her when she was provoked.
But Javert here on a less symbolic and more realistic plane reminds me very much of my late uncle, whom I adored. He was a real old school cop - and very much of his era. He did believe in justice and the law, and would have thought of himself as a very moral individual, but - as Aurelia says - he painted with a very broad brush. I remember having a very long, convoluted historical discussion with him about Ned Kelly and the circumstances under which he took to crime. After pointing out all the social circumstances regarding the incident at Stringybark Creek, and why Ned and his gang had good reason to believe that they would not be dealt with in a just and equitable fashion, my uncle agreed with me entirely...but said he was *still* a crook, still a bad egg, and police were quite right to deal with him harshly and not give him any benefit of the doubt. He was speaking from many, many years of experience of dealing with how criminals function. It is trite to say it, but law enforcement officers have to deal with the symptoms of poverty and the other factors that drive criminal behaviour (and not always poverty, of course) - they have little leaway to assess as a reformer would, or a case analyst who can go into mitigating factors. They have to operate on hard-won experience, and is it any wonder that their sensibilities become hardened?
In a sense, I think this is experience working against him. How many stories has Javert heard? There are few innocent inmates in gaol, so the theory goes, if one listens to the inmates. Most criminals would have a grievance - "yes, I stole...but I was driven to it for X reason!" It's one of the lines in the play that works because it sums it up so succinctly - Javert would have been very, very familiar with all those protestations of exenuating circumstances, dependents, etc.
So yes - agreeing with you here, MmeBahorel, that while Javert's triumph and ferocity in this scene are alarmingly at odds with what I think we would like to think of as a rigid but fair character, they are understandable given his extraordinary frustration at this situation and how he feels he has been played. From his perspective, it would be rather out of the ordinary than otherwise to assume that the Mayor - who you know to be a criminal and persistent offender - is anything other than a man living behind an elaborate facade. You occasionally run across the fanonical ideal that Javert is simply an avatar of the law and is coolly dispassionate and detached, but of course the text reveals him to be quite otherwise - striving hard for justness, he still takes a personal relish in the chase and the fulfillment of his job.
"The principles of freedom, of humanity, and of justice, will finally triumph over falsehood, tyranny and delusion, and every principle inimical to the interests of the human race" - Edward Despard, 1803