12V Relay Actuation Depending on PWM or Constant DCV Input
You are worrying about a condition which is not necessarily a problem. Basically, you're concerned that you might not be able to reliably drive the relay when the 12 volts is being PWM'd, right?

Well, that has its own answer: Don't. That is, only actually drive the relay when PWM is not present. You need to be aware that relay contacts come in two flavors, normally  open or normally closed, where "normally" means with the relay not activated.

So, use your filter/comparator to detect the presence/absence of PWM, and only drive the relay when the input is DC. Select your contacts to produce the result you want.