The woman alighted from the San Francisco train “at the very last second" and the dog remained on board, transit officials said.