The Justice Department said it has reached an agreement to fix the jail’s “dehumanizing conditions” following multiple deaths.