The boy continued to whip the pony , and eventually the pony threw him over. John laughed out quite loud. "Served *him* right," he said.

Are "him" and "boy" the same thing in the aforementioned sentence?
yes