First of all, Porygon can't even learn Hydro Pump OR Earthquake. If it could learn these moves, then yes, Hydro Pump would likely OHKO Heatran if a Choice Specs was held.
Second of all, Porygon's coming off of an 85 attacking stat, while Heatran's coming off of 130. The chances of Porygon's survival without a oHKO are extremely slim. You'll want Recover and Conversion2 with you if you wanna beat a Heatran.
The only way Porygon would have any chances of winning would be with a Focus Sash or Choice Specs, along with Hidden Power (Ground) at max Base Power.
If you can pull that off with Choice Specs, you'll be garanteed a KO, as long as the Heatran has no Special Defence EV investment, and it probably won't.