I'm sure Atticus made his stand at the jail out of a sense of justice, and he would not have considered it a courageous act. However, I believe that his action shows elements of both courage and justice. Having heard that there might be trouble at the jail, he decided to protect his client by standing guard throughout the night (if necessary). His motivation was simply to see that Tom made it to trial alive. However, he also must have recognized that one man against four carloads of men bent on a lynching were not good odds. He knew that he might be injured, but he claims that the men would not have killed him.
Jem spoke... "He'da killed you last night when he first went there."
"He might have hurt me a little," Atticus conceded.
Atticus' humble nature would never have allowed him to gloat over his actions; instead, he gave credit to Scout.
"So, it took an eight-year-old child to bring 'em to their senses, didn't it?"