Justices ruled in favor of employees who faced retaliation after complaining about race and age discrimination.