> If child A is bullying child B because they themselves are suffering abuse at home

Experiencing hardship doesn't excuse violence against others, just like it wouldn't excuse breaking the law. You can say "here is the punishment for your bad behaviour, now let's ALSO have child services remove you from that environment AND have the justice system punish your parents' bad behaviour". Everybody has their job and if they do their job, then what's the problem?

> Just beating up child A is no more productive a solution than throwing people in jail.

Firstly, there's no "just do X" for multifaceted problems. Secondly, people these days dramatically underestimate the value of prison. Over 60% of violent crime is committed by under 5% of the population. Don't underestimate the value of simply removing repeat violent offenders from society.