Well, if you were to stand before the judge, declaring that you are the representative, mediator, and intercessor for your brother, and that you are completely willing and able to receive his punishment in his place, I don't see anything unjust about that.
Actually, we do see examples of this in the world today. Please keep in mind that none of these examples fully and exhaustively represent what Christ has done for his sheep, but they are examples of mediation/intercession or atonement of one for another:
1) A son maliciously steals his father's car, and gets into a car accident. The father offers to pay for any damage done to the other car or its occupants. So even though the son is responsible, the father covers the debt on behalf of the son.
2) Commanding officers in the military will sometimes be willing to take full responsibility for the actions of their subordinates. In this case they try to take the punishment and pay the debt that the subordinate has incurred (this is often described as 'top cover' in the military).
These are just a few examples I could think of. I am sure there are alot more. Obviously if you were to stand before the judge and try to mediate for your brother, it is up to the judge to 'show mercy' in this situation and accept your 'sacrifice'. God is indeed merciful, and he demonstrates this in the redemption of a particular people.