When you refresh from production any running workflows are ended. There are a couple of options, disable the workflow service on the STG/UAT server or you can create a STG/UAT Prep package which would disable to schedules or workflows. I have a package which I run on my test environments to configure all the test email settings once it has been refreshed.
Another idea to test is if you have a DNS address for HEAT correctly configured you may be able to use the $(ServerURL()) function and test to see if your on the Servicedesk-STG.xxx.com or Servicedesk.xxx.com etc.
I was able to sovle it by using an existing global constant where we store the tenant name, STG, UAT and PRD. In the scheduled workflow I update a new field value in "ScheduleEntry" with the value from the global constant. I can then use the field value in an IF-block and send only if exit is true.