I'm glad you have such compliant, well behaved children. I also agree with PP not all kids are the same. I think the way OP handled it seemed to work fine. I might have used the stern mommy voice (not mean, but the I'm serious it's time to listen voice) to make sure he understood. But that's about it.
My children are well behaved and compliant because they have been taught how to behave from a very early age. I just gave my opinion in how I would have handled the situation which was, in fact, the same as OP except I would have found the parents/caregiver. If my child was doing something like that I would like to be informed of it because that is NOT acceptable behavior to me and they would be immediately corrected.