A federal judge has given prison terms of about 10 to 40 years to six white officers for an hourslong egregious and despicable" attack.