Immigrants' lawsuit challenges detention