Jem and Scout also think they are in big trouble after Atticus discovers them in the balcony during the Tom Robinson trial in To Kill a Mockingbird. The two children were supposed to remain at home and away from the courthouse, but their curiosity got the best of them. When they discovered there were no seats left in lower level, they accepted the invitation of Reverend Sykes to sit in the "colored section" on the second floor. From here they watched most of the trial, including Atticus' summation. Shortly afterward, their hearts fell as they watched Calpurnia slowly approach Judge Taylor with a message for Atticus. The message from Alexandra revealed to a shaken Atticus that his children were missing, but he soon discovered that they had been just a few feet away the entire time.
You can find the answer to this at the very start of Chapter 21. Atticus has just been made aware that his kids are up in the colored balcony and he calls them down.
When he does that, Jem comes down and is saying that "we" (in other words, his father and Tom Robinson, but he is including himself) have won the trial. He thinks Tom will be acquitted.
This shows how naive Jem is. He really actually thinks that there is a possibility that the jury will decide based on logic and fact. He does not understand that the racial dynamics are going to trump everything else.