Sydney Carton shows his love for Lucie by following her to France, and trading places with her husband so that he is executed in his place.
For most of the book, Carton pines silently for Lucie. By the time he meets her, she has already met Darnay. His fate is sealed. She will never love him. He is a drunkard and a coward, so she does not expect him to. He sulks and spends as much time near her as he can, trying to make himself part of her life as a friend. She lets him.
In Book 3, Carton is aware that Darnay is in danger. He figures out Barsad’s role from the trial and his relationship with Miss Pross. Yet there is little he can do to protect Charles.
Carton is deeply affected by the prophetic pleas of little Lucie.
“Now that you have come, I think you will do something to help mamma, something to save papa! Oh, look at her, dear Carton! Can you, of all the people who love her, bear to see her so?” (Ch 11)
She is a reminder that Lucie has a life she loves, here with Darnay and her daughter. He feels powerless, and uses what power he has.
So he decides to take advantage of the coincidence that allowed him to get Darnay out of prison in England. Since the two men look alike, he trades places with Darnay. He knows that he cannot have Lucie, so he sacrifices himself to help her be happy.