A passive Perception check is appropriate, at disadvantage
As the PHB says under Passive Checks (p 175):
A passive check is a special kind of ability check that doesn’t
involve any die rolls. Such a check can represent the average result
for a task done repeatedly, such as searching for secret doors over
and over again, or can be used when the DM wants to secretly determine
whether the characters succeed at something without rolling dice, such
as noticing a hidden monster.
I've highlighted the two reasons given for using a passive check, and expand on each below.
1. The average result for a task done repeatedly
Firstly, doing things repeatedly: passive Perception is normally applied to guards doing their job, which is constantly keeping watch, and to adventuring PCs who aren't distracting themselves with other tasks such as making maps. It represents a state of alertness in which a creature is on the look out for trouble.
Your character B drinking ale is not on the look out for trouble, but their senses haven't gone completely AWOL either: they should have a chance of spotting trouble, but not as much as if they'd been guarding a gate or crawling through a dangerous dungeon. For creatures like this, it's reasonable to allow passive Perception, but at disadvantage to represent the fact that they are not being alert.
If character B were making a map, or searching for treasure in foot locker, then they are distracted. The rules give the DM latitude to rule that such a character cannot benefit from passive Perception. But to be honest, character B is probably about as alert to danger as they would be nursing a pint in a tavern. So again, a passive Perception check with disadvantage is justified.
2. When the DM wants to secretly determine the outcome
A common reason for secretly determining the outcome of an ability check is to reflect ignorance or a lack of awareness. The passive check keeps both the PC and is player in the dark, and it avoids meta-gaming. That's appropriate here: character B is unaware of character A's intentions and so can't play an active part in the scene, unless and until they notice what's going on. And here noticing is a purely passive thing.
So a passive Perception check - with disadvantage - is warranted by the rules on passive checks.