This actually takes place in chapter 17. Tom is a hero for simply being alive at his own funeral. As the mourners, congregation, and even the preacher begin to cry with such movement, the church door creaks open, unnoticed. Standing in the door are Tom, Huck, and Joe who had been hiding in the unused gallery listening to their own funeral sermon!
The families throw themselves over the "restored" boys, and even Huck is lavished with kisses from Aunt Polly. The event is almost miraculous, and Tom confesses "in his heart that this was the proudest moment of his life."