Question:
Why did Abraham protest so strongly on behalf of a handful of lowlife Sodomites, and yet submitted silently when commanded to sacrifice his own son?
Answer:
This is a beautiful question. In fact, my daughter asked me this question some years ago. But then, she also told me the answer.
Take a look at the way G‑d speaks to Abraham in both instances. Concerning Sodom, G‑d informs Abraham that “the cry of Sodom and Gomorrah has become great, and their sin has become very grave. I will descend now and see, whether according to the cry which has come to Me they have done; [I will wreak] destruction [upon them]” (Genesis 18:20–21).
Something similar occurs with Moses during the Golden Calf affair, when G‑d tells him, “Now leave Me alone, and My anger will be kindled against them so that I will annihilate them” (Exodus 32:10).
As Rashi puts it, was Moses holding on to G‑d, that G‑d had to say, “Leave me alone”? So Moses understood that it was his job to argue with G‑d, which he did.
Similarly, when G‑d informed Abraham of His impending judgment of Sodom, he understood what G‑d wanted of him—to argue. Otherwise, G‑d had no reason to inform him of His intended action. So argue he did.
Concerning Isaac, G‑d literally pleads with Abraham: “Please take your son . . .” (Genesis 22:2). He then understood that this was not something to argue about.
Really, it’s the same with every Jew. We have a deep relationship with G‑d. We aren’t just robots. There are times—the times of prayer—when we argue with G‑d concerning the way He runs His world. And then there are times when we need to just accept. How do we know which path is appropriate in any given situation? We know, when we are in tune with our neshamah (soul) deep inside—and the neshamah is in tune with G‑d above.
[Additionally, Abraham wanted to avert a punishment intended for the people of Sodom. The Binding of Isaac wasn’t intended as a punishment. Ostensibly it was to be a great privilege for Isaac to be sanctified as a sacrifice to G‑d.]
Rabbi Tzvi Freeman for Chabad.org

Abraham’s Test
“Here I am” means more than blind obedience. As Abraham demonstrated, rising from pain to humbly great the visitors, and arguing with One about the justice of killing righteous with the wicked, kindness together with standing firm, even with the One, for all he saw as right, demonstrated truly that he was here. What then do we learn from Abraham’s test when called to take the son that he loved in sacrifice to the One? Abraham answered the call with “here I am” even before hearing what the request was. Upon hearing the nature of the call, he rose early with his test. Abraham went with his son, the fuel, fire and observers, determined to make the test not with words as before, but with his actions to show his righteousness, even to the point of raising the knife above his beloved son. How long did he hold up his outstretched arm? The Torah does not say. But it was long enough for the One to send a messenger to tell him to stop, that Abraham’s test had been successful.