As others have said, I wouldn't intervene unless they were beating the child or actually causing him real harm. In this situation, I might find it difficult to intervene myself but I would alert another adult near me or call the police. If they were just smacking their child though in a reasonable way, then I probably wouldn't think anything of it and just walk past, if a little uncomfortably as I would feel if they were just screaming at him.