NEW YORK — A federal judge has ordered Amazon to stop retaliating against employees engaged in workplace activism, issuing a mixed ruling that also hands a loss to the federal labor agency that sued the company earlier this year.