If only it were that simple... The whole point of EASA is that you can get a medical anywhere - without that country holding your medical records.
In this (hypothetical!) case, you would have a valid IAA medical, but the IAA would not hold your medical records, as they are currently held by a (now) non-EASA country.
Since the issuance of a pilot licence requires holding the medical records - would the IAA accept those records post-brexit, or would they revoke the medical?