Short Version:
Maybe P is overwhelmed by bookkeeping and it's distracting him from situational awareness. Help him make a mechanically very simple character without fiddly bits or conditionals to keep track of, so he can focus on making good choices rather than having good bookkeeping. Invite the other players to support P with advice and by being good role models for the behaviour he's trying to cultivate.
Long form answer, with rambling and details.
Back in my very first RPG ever--and also my first time as a GM--I had a player whose poor choices got him repeatedly killed. Let's call him Q.
Q knew the rules and mechanics quite well, but had a very hard time applying them intelligently to whatever situation he found himself in (like forgetting to heal himself as a cleric). Even more than that, though, was his role-playing: he really really liked to role-play his characters, but that got him in trouble because when Q got deep into his character's internal motives the PC would lose common sense and perspective about the surrounding context of his actions.
It got bad. Really bad. Q's second character was killed by the party for betraying them (he had a conversation about his friends over tea with a "nice" lady). At that point I shared Making the Tough Decisions with the group. He studied it carefully, had intense discussions with me about it... and as a direct result his fourth character perished of untempered curiosity: the characterisation "very curious" overcame the common sense "half these items are cursed and my friends are begging me to stop," until the pile of treasure he was investigating yielded up a lethal curse.
After that session I took Q aside and we talked. He knew he had a problem, and he was trying to "get better," but he needed help. I'd noticed that all his PCs so far were mechanically complicated and required in-game bookkeeping: advanced casters and races with lots of conditional features and spell-like abilities to keep track of. So we hatched the simplest possible character build: nothing to keep track of. No "if you're flanking, X also happens," no spells, no per-day abilities. If his character sheet said he could do a thing, he could always do it.
We wound up with a kind of Indiana Jones flavoured skillmonkey (a rogue chassis with homebrew mods to replace things like sneak attack because tracking whether you can deal that extra damage was beyond what we wanted for the build). He wasn't optimised in the traditional sense--but since another PC in the party had straight levels in the NPC Expert class, that wasn't an issue in keeping him relevant in the group. Instead he was optimised for what Q needed: a simple no-bookkeeping character to let him focus on situational awareness and making good choices.
At the end of each session he'd hang back --along with any other players who wanted to-- and we'd reflect on the game: what worked, what didn't. We'd consult (and if necessary research) and come up with what to make sure we did again, and what we'd change next time. (I've since found that any game I run which has some form of this "reflect and plan" dynamic after every session is improved by it.)
In tandem with another player rising to the challenge and being a kind of "teach by example" role model, it worked. A year later Q was successfully running complicated wizard builds with great party dynamics and great depth of character. He was a real joy to work with, and all he needed was to wade in at the shallow end of the bookkeeping pool instead of jumping into the deepest part head-first.
nota bene: My players have tended to treat the group dynamic as one of table-level cooperation between friends. However much their characters may be rivals, at the table they collaborate to tell the best stories, and I'm also one of the collaborators. In groups where players and/or the GM act as rivals at the table level of things, I'm not sure how much my experience will be useful. It sounds like your whole group isn't really on the same page in terms of their desired gameplay experience, and communication isn't really strong. Working on improving the "friends at the table" level of things might help your game in a number of ways.
First off, these things sometimes happen. If this is a one-off occurrence, I wouldn't be too concerned: people sometimes get it into their heads that they need to do something "weird" for no good reason. I was playing in an In Nomine game as an angel who could possess people/animals; I somehow decided that I needed a monkey, and we spent about as long planning a zoo heist (that never happened).
So, one-off: don't worry too much.
If this is a more common event, or if it looks like it might be (Tom sounds like he might encourage this kind of "weird strategy" thinking), there are a couple of things that have been helpful in my games:
talk to the "problem" player(s): remind them nicely (and privately) that there are other players who need to be included in the action and the planning. yes, this is the default answer to anything with the problem-players or problem-gm tags; it's the default answer for a reason.
remind the players that time is passing in-game. In this particular example, while Tom and Frank were discussing what to do with the interlopers, the captain could be struggling against his bonds, the captors could be rummaging around the cargo hold, a sailor could be whimpering behind a crate. As the planning session goes on, the captors might get more violent, roughing up a sailor who gets in their way. D&D does encourage some "free action" tactics talk among the players, but time does flow.
if they still don't get the hint, a brigand could actually accost the PCs: demanding money, ordering them around, etc.. Roll for initiative! And, remember that the brigands are totally getting a surprise round (are those still a thing in 5E? Sorry, my experience is almost all 3.5/PF). I'd encourage relaxing some of the rules about how long talking-type resolutions take (or, at least, suspend initiative if someone rolls well enough to warrant a brief cease-fire), but there comes a point where conflict is inevitable (this is a good thing: the whole point of RPGs is resolving conflict) and the PCs can't just talk amongst themselves any longer.
alternatively, poll the players to see if they want to continue with strategy or move into action. Tom and Frank can talk about tactics all they want, but if the cleric steps in to stop the pirates from harming their ship's captain, Tom and Frank will have to respond. This can backfire! Tom and Frank can be angered by the cleric acting "before they're ready"; therefore, I encourage mixing this in with #2: "Tom and Frank are whispering about what to do; Cleric: you see the brigands roughing up the sailor; Druid: they're dumping something unpleasant from the hold into the bay. What do you do?"
I'd personally be hesitant to actually use one, but I've seen suggestions to use a small hourglass (a 30-60 second timer) to let the players discuss how to respond to a new situation before in-game time resumes. The in-universe logic being that the PCs have been traveling together for long enough that they can quickly communicate how to respond to violence with a subtle gesture, where the players need to actually talk.
You'll have to be a little careful to not step on Tom's fun in planning intricate strategy, but that's relatively easy: make sure that there are plenty of encounters where the PCs know what's coming far enough ahead that they can talk for a few minutes in-game before the enemies know they're there.
Best Answer
I’ve seen this issue from both sides. As a GM, it’s really easy to say something ambiguous or describe something in a specific manner that the players interpret as “ooh, let’s check that out” instead of as “hmm, interesting, now let’s go”. As a player, I (which may not be the same for your players) find it fun to check out every little side thing even if nothing is there.
Sometimes, when you have a very specific timing out of game for the session (like if you are running a one shot and won’t be able to continue later), or if you’re running a published adventure, you may not have time or the information to devote to these little side quests. In that case, I would tell the players, out of character, that whatever they’re doing could be done an easier way or with less effort. It’s okay to tell them things out of character, especially if it makes things easier on you.
With that in mind, however, sometimes the most fun stories come from failure. I can’t begin to count the number of times I’ve been a player, we’ve made all these plans to get in unseen and succeed on an objective... and then discover we overthought stuff. If you’ve got players that like trying things even if they fail, it’s okay not to give them a big reward if that’s how you think it should go.
As a GM, my favorite session was when my players were stopping a dragon, they made some huge plan to sneak into the well protected lair, and discovered... a pile of cheap romance novels. I got a handful of dice thrown at me immediately after this reveal, but after the session, one of the players told me she actually really liked that not everything they did had huge rewards. She thought, like I did, that the fun was in the doing, not in the reward.
If your players enjoy it, there’s no problem with just giving them the planned reward. If they start to complain, I would suggest asking them whether or not they want to be warned when the plan is too complex. It’s okay to tell them their plan is not the easiest way to succeed. All in all, whatever you decide to do is fine and will end up making the game better.