Charles Darnay resembles Sydney Carton. This is important for two reasons. First of all, Carton gets Darnay acquitted because witnesses cannot tell the two men apart. Second of all, both men are in love with Lucie Manette, but Carton uses this to switch places with Darnay before he is executed.
In the courtroom, Carton seems to be a lush. He does not pay attention to anything, yet somehow sees Lucie Manette drop her head and asks to have her taken out. Carton is aware of more than he seems to be. As a brilliant turn, he compares himself to Darnay and asks the witness if he can be sure which man he saw.
“Look well upon that gentleman, my learned friend there,” pointing to him who had tossed the paper over, “and then look well upon the prisoner. How say you? Are they very like each other?” (Book 2, ch 3, p. 48)
This endears Carton to Lucie enough that he is able to enter her circle of friends, and hang out at her house. He is well aware that she loves Darnay, yet worships her from afar. He is able to use the fact that they look so much alike once again, in order to trade places with him when Darnay is sentenced to death.
“Of all the people upon earth, you least expected to see me?” he said. (Book 3, Ch 8, p. 223)
Of course, Carton dies famously—saying it is a far better thing he’s doing than he has ever done. Unable to have Lucie, he has done the next best thing. He has ensured her happiness.