I think I see where the confusion is, but please correct me if I'm not quite understanding your question.
It's possible to misinterpret that section in Mastering Bitcoin as saying that there is one shared revocation public key between A and B, and A has one half of the secret and B has the other half. This is how I first understood it. It ends up not making sense, however, because when they exchange secret halves, both A and B now have all the information needed to publish their own previous commitment transaction and simply use the complete secret to get all of the funds.
Instead, there are actually two different revocation public keys, generated individually by both parties. Let's call them revpub1 and revpub2. A has revpub1 in the output of their commitment transaction and B has revpub2 in their own transaction. The way that these public keys are generated ensures that each party initially has only half of the information needed to unlock each key.
When B revokes their commitment transaction, it means that B is giving A the other secret half needed to unlock revpub2, but B doesn't have the first half of the revpub2 secret that A already has. B only received the other secret half to revpub1.
Now, if B decides to try to cheat and publish their prior commitment state, only A has all of the information necessary to unlock revpub2 and take all of the funds. In this case, it's impossible for B to unlock revpub2. The only thing B can do is wait to spend the output after the number of specified blocks has passed, giving A time to penalize the cheater.