You know, I would usually do what you did-- try to redirect the boy to play with peers his own age and to advocate for my own child by setting clear boundaries.
From your description, he wasn't there to engage with your daughter-- he was there to engage with another grown-up, and it happened to be you. You chose to be kind to him and to offer age-appropriate alternatives to his undesirable behaviors. Some other adults might not have. Modeling kindness teaches your children to be kind, and drawing lines when necessary lets them know that they don't need to be a doormat.
What is truly sad is that this child had no one in his corner (mother, family, sitter) who cared enough to help him. A big part of what we as parents do in the park (hopefully) is socially coaching our children to get along and play in a friendly way around other children. If his parents aren't savvy enough to find a sitter who is interested enough to actually do the job, to engage, and to discipline the child when necessary (hello! pushing/hitting gets a time out, immediately!), chances are that the parents may be at a loss in their parenting skills.
Personally, if my son hit some at the park, we'd leave immediately. No going back that day. I'm fairly strict with him, and also feel that we have some accountability to the group as a whole playing there. Toddlers hitting is one thing; a five year old knows better and should have been benched if they couldn't leave/siblings were playing.
We sometimes have children at the playground whose parents are inattentive, and then I do give the guidance *I* feel is appropriate ("You can play poking sticks over there, we're doing X over here"). However, if there's a child who really is trying to engage by using negative behaviors, we just find another place to play or I gently move the kids along to the next activity of the day. Those moments are few and far between. I've learned that actually addressing a parent who is actively ignoring their misbehaving child will only make me the bad guy in that parent's eyes. It is very, very sad, but that's the way it is for some people.
And if, perhaps, the child has a behavioral issue, I think the onus needs to be on that child's parents/adults to *help* them get along socially through active guidance. This is in the child's best interests, really...kids who are already having difficulty navigating social settings need the best, most positive experiences and outcomes they can get, and adults really need to help kids with this. I'm a preschool teacher and often see that even though most adults think the kids are "old enough" to go off and play without help, many children really do need a listening ear and helping adult from time to time. Even if only so that they can learn how to stand up for themselves and ask for what they are needing. I can't imagine having a child with social challenges and NOT being present to help them when they are still so little.