The room is accessible before the cave-in; you do not have to keep up to Martis.
In the original release of D2:ED I mindread Martis in the cell, but did not use that information to complete the quest early. In that case when you get near the underground portion of the prison you find that he has already been broken out of jail, and there is no cave-in triggered. In DKS I avoiding that mindread and broke Martis out myself, but didn't get a cave-in doing the quest that way, either.