​A federal judge criticized the government’s actions in an immigration-related case on Tuesday, after learning a hearing was scheduled for a man’s possible deportation just one day after he challenged his detention in court.