In a good environment, you do something like give your boss a flag "hey, this PM is putting a two-week deadline this thing which we can't do by then because of all this other scheduled work" so they can have a chat with that PM's boss and then the two of them can potentially rope in whoever else is needed if re-prioritization is really necessary.
That's what middle management is for. The PM isn't your boss (I'm assuming). And they have a boss too who's job is to keep them in check, and the other middle managers are supposed to have relationships with each other. If there's any sort of middle management at the company yet things like that still either fall on the individual developer or dev team, that's a pretty bad environment (which then falls on the CTO, for having a tech management team that can't navigate the company, but in a different way that it would be on them than in a tiny company with devs reporting directly to the CTO.)
That's what middle management is for. The PM isn't your boss (I'm assuming). And they have a boss too who's job is to keep them in check, and the other middle managers are supposed to have relationships with each other. If there's any sort of middle management at the company yet things like that still either fall on the individual developer or dev team, that's a pretty bad environment (which then falls on the CTO, for having a tech management team that can't navigate the company, but in a different way that it would be on them than in a tiny company with devs reporting directly to the CTO.)