Not really. Even when flanked, their high rear armour means it's ridiculously difficult for non-doctrinal mediums to do damage. And said heavy tanks, if they even can get their turret facing the target can then rotate as fast as most mediums can circle strafe.
Look at P4s vs IS-2 sor T-34-76s vs KTs. They have extreme difficulty even punching through the rear armour at point-blank.
The P4 versus the IS2's rear armor isn't as bad as 76's versus the KT's rear armor. But ultimately the problem with Heavy tanks is that they are
to cheap for how well they preform.
The only heavy tank that is appropriately priced is the KT, because you have to tech for it and there is a reduced fuel income. If all the other heavies followed the same model you would see a lot more mediums because heavies wouldn't be cheaper than mediums due to teching.
P4's cost more than a IS2, but the KT costs as much as several T34/76's.