I would've done exactly what you did. If a child is hurting your child, you step in and stop them from causing further harm. They weren't fighting over a toy or who sat in what spot first.
There was a 3 or 4 year old throwing mulch in the face of my 6 year old at the park a few weeks ago. My 6 yo told him to stop, but he kept doing it. So I looked him dead in the eye and said, We don't throw things at people. He backed off, but 2 minutes later had another fistful of mulch and was ready to aim at another kid. I looked at him and said "Don't throw mulch. That's not acceptable."
I was prepared to do battle with the parent if they got ticked off, but luckily when the mom appeared a few minutes later she didn't mind. I was also prepared to tell a parent off for not supervising closely enough, but she was super-duper pregnant, and waddling back up from the port-a-potty, so I gave her a pass
