Atticus said that Mrs. Dubose was a great lady because she was struggling to overcome a debilitating addiction, and she decided to do it cold turkey, alone, at the end of her life. She wanted "to leave this world beholden to nothing," and so decided to break her morphine addict. He said that she demonstrated true courage, which was "when you know you're licked before you begin but you begin anyway and you see it through no matter what." And that is exactly what Mrs. Dubose did; she undertook the fight to break her habit even though the odds of really breaking it were very slim, but she did it anyway. It was hard, very hard, but she stuck it out, and that is why she was such a great lady.
This relates to Atticus taking the Tom Robinson case, because he knew when he took it that he probably wouldn't win it. But, he took the case anyway, just like Mrs. Dubose decided to kick her habit anyway. And, Atticus saw it through no matter what-even though people were mocking his children, even though an angry mob showed up at his door, even though a mob showed up at the jailhouse, and even though it set many people in the town against him. He did it anyway, and kept going, even though he knew that he probably wouldn't win it. So, Atticus fits his own definition of courage that he had originally applied to Mrs. Dubose. He starts a battle he can't win because it is the right thing to do.