Hundreds of foreign-born criminals who were let out onto Australian streets following a court ruling will be deported to Nauru.