Yeah passive sonar doesn't pick up non-moving objects (it only listens for other ships' drives, IIRC) so it wouldn't "see" a change in seafloor terrain. Active sonar would have, of course, but the whole point of an attack submarine is to sneak up on its target so when on manuvers it's not actually that likely that the crew would be allowed to ping. That said, it's actually bery fortunate that the sub hit the mountain dead-on, since there's a lot of bulkhead between the sonar cone on the nose and the pressure hull. Had it somehow been a glancing blow, I doubt the ship would have been so lucky.