The ruling applies to Minnesota’s federal courts where hundreds of noncitizens have challenged their detentions.