With two weeks of intense heat it's probably more software than hardware, but there's a detail nobody mentioned: Instagram and TikTok constantly use the accelerometer and gyroscope for vertical videos, camera effects and all that infinite scroll stuff. If you also have auto brightness turned on, the processor is working at full capacity non-stop. I noticed something similar with my iPhone last year and it was because I had a ton of tabs open in Safari in the background while I was watching videos.
First thing I'd do is check Settings > Privacy > Motion & Activity to see if those apps have access. Turn off "Motion & Orientation" just for Instagram and TikTok and set brightness to manual when you use those apps. Also check Settings > Display & Brightness > Graphics Performance, though on the 14 Pro Max it shouldn't be an issue. If you see the heat is concentrated in the camera area (back top), then it could be the battery or something more physical.
A hack that works: open both apps but with no sound for a few minutes (total silence) and see if the heat goes down. If it does, it's almost definitely video processing. If it stays equally hot, it's more likely the battery. In that case you'd need to get it checked because even though the phone is relatively new, batteries sometimes come out defective from the factory and get worse fast. In the meantime, use those apps with your phone in dark mode because it uses less battery and generates less heat.