Kellogg has been ordered to end its nine-month Memphis plant lockout by a US district judge.