Let me tell some stories:
1. The negotiations with Hector Valois
In this mission, my PCs were tasked with bringing peace to a group of nations that were beseiged by what I described as a Dragonlord. Hector Valois was sending his minions out on raids, claiming territory and assaulting villages with impunity. Had the PCs fought him on day 1, in his own domain, he would've slaughtered them. Instead, the PCs decided to negotiate a peace summit between the 4 nations and Hector. Along the way, they decided that Hector was both likely to negotiate dominion over the combined territories, but also a tyrant. Determined not allow this outcome, they searched far and wide, finding the oldest Dragon (a Gold) alive to supplant Hector. With this Gold Dragon in tow, picked a fight with Hector within the summit's main event.
The PC's "team" consisted of a few volley-archers off-screen, a CR 16 Gold Dragon, and 3 ECL ~8 PCs (my ruleset is E6+Gestalt in 3.5) against Hector (CR 10+), and 3 young adult dragons (CR 9/11/13 respectively). The PCs were HOPELESSLY outmatched for the fight they took, but then again, that's the fight they CHOSE to take.
They could've lured Hector into an ambush. They could've picked a fight when he didn't have his dragons in support. They could've organized a larger response to him. etc, etc, etc.
2. The unfair trade with the Wizard Dominic
Another group of PCs I was gaming with have an interesting story. One day, a PC was cursed/wounded/whatever, and required a real cleric's aid. The PCs decided that their best course of action was to find a cleric who was wanted on the bounty boards and get that cleric's help. They found and made a deal with this necromancer, and then instead of paying him, attacked him. The necromancer escaped. Later, the PCs manage to hunt him down, but in the process of getting close to him, the Necromancer unleashes a terrible retribution: He sends his minions (Wights) to wipe out their favorite town.
The PCs learning this, then decide to try something clever. They contact Dominic, a wizard of GREAT resources and power, and offer him a deal, they'd surrender to his demands of them, if only he'd save this poor town. Dominic agrees, and the town is largely restored, but price proves to high for our plucky PCs.
Reading your question, its my assessment that you would feel attacked by me if I was your DM. Partially, this is because even in your own retelling, none of the other PCs are objecting to the DM's behavior. Partially its because these actions seem mostly reasonable, except for your value-judgements of them. I believe that the correct course of action for you is to start assuming that your DM is both A) acting in good faith and B) acting with a degree of skill such that you might learn something from him if you ask WHY he's running the game the way he is.
Essentially, my advice to you is simple: Talk to your DM. Make it clear that you are not having fun, but DON'T characterize your lack of fun as his fault. Let your DM discuss the whys with you. And if he gives you actionable feedback, act on it.
If some of the other answers don't let you figure out the root of the problem and get him more involved in the non-roleplay segments, that's fine. Roll with it. As long as he has a sense of humour it'll be fine. I've shared a table with many an odd duck, and if they don't fit the game, but you want to keep them around, then you fit the game to them. Otherwise you might as well be playing DnD Online. So from your description, here's what I'd do based on past experience with similar (but not quite as difficult) players:
What you've got here is a stereotypical absent-minded wizard, only in sorcerer form. Just pretend he's role-playing through the middle of combat too. Potentially you might even encourage him to do exactly that since it seems to be his preferred mode of operation. Absent-minded wizards are usually NPCs, but that's not a hard requirement. Shift some of the things you might be tempted to reveal via an absent-minded wizard onto him. Tell them to him privately, with no repeats, and make him write them down himself. His horrible note-taking will play right into your hands. The frustration of knowing that he should know this critical piece of plot-relevant information will encourage him to start taking better notes.
He casts a spell and doesn't know what it does? That's fine, he's a sorcerer and brings magical effects into being by force of personality. If he's not focused enough to shape the forces he's channelling, then you get to just make something up. "Magic missal" sounds like it summons a prayer book for the cleric. "Meatier Swarm" sounds like the enemy is about to get pelted with steaks for a few d6 worth of damage. "Feather Fall" sounds like the party will be able to re-stuff their pillows and bedrolls once they dig themselves out of the pile at the bottom of the cliff. "Mold Earth" and "Burning Hands" could have nasty side-effects... Especially near steaks or feathers.
Don't explicitly tell him the combat's over. If he wants to keep shooting at things that are already dead, that's fine. People sometimes do this in real life too.
He can't come up with one of his stats within 20 seconds? That's fine, he's obviously too distracted to really be attempting the check anyway, so make up a number for him, say by rolling some number of dice (probably 1-3d6 depending on what you're replacing.) Don't tell him what it is, just have him roll the d20. Insert improbable explanations for successes or failures near the edges of the bell curve.
His talent for roleplay gets to be useful to the group. His ineptitude in combat gets to be entertaining, without dragging things out to the point where the delay becomes frustrating. In a group as large as yours it's ok to have a couple of characters who aren't combat-oriented. Have the cleric take charge of plunking him down somewhere with good cover at the beginning of a fight so he can shoot his crossbow one-handed over a rock without looking and hope for the best. If he's really into role-play then getting him to play a character in a fight, not just a collection of numbers looking for optimal paths to kill things may well be your last hope of getting him more involved, and a panic-prone, absent-minded magician fits what he's already doing, so it would be a good starting point. He can develop the character further as the plot thickens.
Best Answer
These answers pretty well cover several of your options, but I'd like chip in a few others.
Targeting
As others have said, be aware of how the spell is cast. You must be within 30' of your initial target, must have line of sight on an initial mind-reading target, then must use an Action to switch it to a new target. OR you may scan for thoughts within 30' of you and use an Action to pick one of those thought sets to chose from
So, you have three options here.
1: You cast the spell, involving speech, gesticulation, and a copper coin within line of sight of your target. This is super suspicious. And will probably end in combat or summoned guards. And, however it pans out...the spell will have expired by the time things calm down.
2: You cast the spell outside the line of sight of the target, then move to within line of sight and shift the spell, this burns a round of time (I'll get to that in a second.) Assuming it only takes you 1 round to get into line of sight of the target. And, bear in mind, someone else might see you casting and freak out. I'd be calling for stealth checks here if they were in a populated area.
3: You cast the spell outside the line of sight of the target, then attempt to hone in on the thoughts of your target without moving into line of sight. The catch here is, you detect every intelligent creature within 30' and have to pick which one you want to focus on, consuming an Action. This includes your allies and any bystanders, and the spell does not give you any information about the intelligent creatures besides 'they are within range of the spell.' You don't even know which direction they are in. If this is how they are doing it, determine how many people are within range of the casting, and roll the dice to see if they picked the right person.
Time
The spell lasts for 60 seconds. 10 rounds. Most conversations last significantly longer than that. And unless they cast the spell directly on the target (requiring line of sight) then they burn 6 seconds to take a round and Action to switch the spell to their desired target. So, more likely, they can Detect Surface Thoughts for 54 seconds.
So, have your NPCs engage in small talk...like actual people would. If the players try to push them straight to the topic, feed the person reading their mind thoughts about how rude they think the players talking to them are...and allow that to run a risk of the NPC refusing to talk to them further.
In social interaction, 60 seconds is not a long time. Particularly if the players cast the spell before trying to start the conversation. Have the NPC putter around their shop for a bit before coming to talk to them...have them be already talking to someone else when they arrive...have an interruption occur (such as someone else entering the shop). Anything that eats up time. They are taking a gamble by casting Detect Thoughts that the relevant topic will be discussed within 60 seconds. This isn't an interrogation where you just start demanding answers...and if they treat it like one, I'd expect no one to want to talk to the players next time they are in town.
Obviously, don't abuse this...let Detect Thoughts work sometimes. Otherwise you'll just frustrate them. But it shouldn't be the all-solving-hammer they are currently using it as.
Hard Counters
If you have a villain, you want to block this, especially if they are going to deceive the players directly. For this, you need hard counters that absolutely block mind reading. You have a few options...
The obvious option here is Mind Blank. You are immune to mind reading. Period. They try to read your mind, and get nothing.
Next is the 17th level Mastermind-Archetype Rogue's ability, Soul of Deceit. They can block attempted mind reading with ease, or even roll Bluff to present false thoughts to attempts to do so.
Creative use of Modify Memory can bypass this. The villain could temporarily alter their memory (leaving a written note to tell them to undo the spell later) to believe they are telling the truth. Thus, 'Detect Thoughts' would accurately pick up on false information.
Mordenkainen's Private Sanctum shuts down Detect Thoughts entirely...one of the options is that no creature inside the Sanctum can be targeted by a Divination spell. You could even play this off as the other person casting or entering an area under the effect of the spell to 'make sure their conversation remains private.' The RAW allows for permanent versions of these...so a wealthy non-magic user could very well have a permanent Sanctum set up for private conversations.
Nondetection is probably the lowest level method of a hard-block. It makes the target immune to Divination spells (and, again, Detect Thoughts is a Divination Spell).
And, of course, Detect Magic would go off if a player using Detect Thoughts entered the caster's range. It wouldn't tell them specifically what you were up to, but they would know you were using a Divination spell in their presence.
Non-Spell Countermeasures
Misinformed NPC. Have the character providing the information be entirely honest and truthful...but the information they give was provided by a deceptive source, so the NPC in question is honest...but wrong. The players may be able to use DT to be immune to manipulation, but the NPCs they talk to certainly aren't.
Pathological Liar. A character like this would probably think about several different 'answers' to their question with no distinction as to which one was true. You know they probably aren't telling you the truth...but good luck figuring out which of their thoughts was the truth.
Superfluous information. People's brains hop around all the time. Don't just give your players the relevant information..dump that NPC's whole stream of consciousness on them. Thinking about what's for dinner, wondering if these adventurers will shut up and buy something, grumping about that spider web they just spotted over your shoulder (I just swept the corners, dangit). Sure...they might get the info they are looking for, but they'll have to dig through a bunch of extra crap to find it.
Hopefully this helps out a bit