A judge ruled that the government did not have the legal authority to continue detaining the Salvadoran national, who is married to an American citizen.