Atticus is a realist, and he has few expectations of actually winning the case. He knows that in 1930s Alabama, a black man accused of raping a white woman has virtually no chance of being acquitted. Tom will face an all-white jury and it
"... couldn't possibly be expected to take Tom Robinson's word over the Ewells'. (Chapter 9)
He believes Tom's only chance is on appeal.
"... I intend to jar the jury a bit--I think we'll have a reasonable chance on appeal... " (Chapter 9)
But Tom's case is not one that Atticus relishes. He did not volunteer to defend Tom; instead, he was handed the case by Judge John Taylor, probably because Taylor recognized that Tom may be innocent, and that Atticus--the best attorney in Maycomb--would be Tom's best chance for a fair trial and of regaining his freedom.
"... I'd hoped to get through life without a case of this kind, but John Taylor pointed to me and said, 'You're It.' " (Chapter 9)
Atticus chose not to turn down the case because he believes Tom's version of what happened and knows that the Ewells must be lying, but he primarily took it because of Jem and Scout.
"... do you think I could face my children otherwise?" (Chapter 9)