A US judge has dismissed a criminal case against a man who was wrongfully deported to El Salvador by the Trump administration last year.