Back in the day, before there was much of anything going on on the internet, entire communities with brainpower of the same magnitude as this one would spend months on end debating whether the USS Enterprise could defeat an Imperial Star Destroyer.
I've witnessed these debates, and they were epic in scale.
Substitute SQL and noSQL, and you'll get an idea of what it was like.
Although do keep in mind that Spock is an explorer, Batman is a crime fighter.
Plus Batman has defeated every superhero he's ever fought against including Superman.
Spock only has one decent fighting move, and it targets the back of the neck. Batman's neck is so heavily armoured that he can't even turn his head.
When milliseconds matter, though, training and experience beat logic. And Batman has years of martial arts training followed by quite a few more years of practical ass-kicking experience in the streets of Gotham. This is why Batman could whup Sherlock Holmes and Mr Spock. (Sequentially, at least. Put them together and they'd outwit him with some brilliant plan.)