I tested it on Showdown and here are the results:
In this replay, STAB Crit Flower Trick from Meowscarada 1 does around 37%. Meowscarada 2 does around 32% with STAB crit Shadow Claw. After Terastalizing, Meowscarada 2 does around 22% with Flower Trick, significantly less than Meowscarada 1, while Shadow Claw does around 34%, which is really close to when it was Ghost type. This means that after Terastalizing, the Pokemon gets the boost from it's most recent type before it Terastalized.
Although Soak failed at the end of the previous battle, I decided to test it more in this replay. Since Tera went before Protean and Protean wouldn't activate even after I switched out, I came to the conclusion that Terastal Pokemon are immune to Type changes.
I hope this was everything you needed and I hope it helped.
(Note: Both Meowscarada have the same EVs, IVs, and nature, the only thing that's different are the movesets.)