He wasn't listening to the conversation for 3 hours. He was seated there for 3 hours, and then he overheard a part of a conversation.
Overhearing is not the same as actively listening. Talking in public is public. They are at a bar, which is an extremely social place, it is normal for strangers to join conversations.
And what place and context is more appropriate than a bar for asking someone out? It has been the de facto place exactly for that purpose for millenia.