Judge orders government to free children and their parents from detention