A federal judge in New York City has ordered the immediate release of a prominent immigration activist.