Interestingly, even the MBP14 with M1 Max performs almost identically (in some cases marginally faster) than the entry level Mac Studio - see the "Constant Geekery" Youtube channel. There doesn't appear to be any performance benefit to the Mac Studio, at least not with 24-GPU cores, over the MacBook Pros, so if you need to have a laptop for mobility, you don't appear to be giving up performance.
Regarding RAM, you will need to carefully study your current usage, and make an educated guess about how your usage might change in the next few years. In my case, I already knew from other machines that I easily use 32GB RAM with my typical usage. The simplest check is to see how often your memory pressure in Activity Monitor goes into "yellow" or "red" memory pressure. If it spends a lot of time there, you might need more RAM to avoid using lots of swap or compressed memory. You probably know that using large amounts of swap memory will write a lot your SSD, which has a finite number of write cycles meaning that excessive write volumes will accelerate wear on the SSD - whether this is sufficient to cause a failure within the lifetime of the machine is open to some technical debate!
As an idea, here is my current memory usage with a 32GB MBP14. Note that even though I have 4GB of cached files (which could in theory be purged), that it is still using almost 4GB of swap and has over 16GB of compressed memory, which is why is sits at "yellow" memory pressure the whole day.
I have about 20 tabs open in Edge browser, 20 in Safari and 10 in Chrome (with "tab sleeping" enabled on Edge and Chrome). Nothing else heavy is open (Mail, Notes, OneNote, Slack and VSCode editor). In my experience, it is web-pages that eat up the memory, but my line of work requires I have a lot of pages open at once (even if sleeping), so I have to live with this - or have 64GB RAM to use a web-browser, which seems....excessive
View attachment 1983844