Judge rules Trump unlawfully terminated legal status of migrants who used US entry app