Mary used to beat her kids.
shouldn’t this be pegarles
“pegarles” or “pegarlos”, but “… pegar a sus niños” should be enough.
Disclaimer: I’m not a native speaker.