Personally I lean towards the highest potential for stardust/candy savings, which in this case would point at your L31 with 15a. Between the importance of defense IV vs HP IV it's largely unnoticeable. You'd have to pour over particular raid bosses with a particular moveset and compare bulkpoints.
I'll say I'd go with the L31 Kyogre, but expect a lot of people telling you to wait now that the precedent of TM-locked legendaries exists. There's room for Origin Pulse to be limited to a 3-hour P2W window, at which point all of those resources spent here could be spent there. Granted, if you're not concerned about that type of thing then by all means go ahead, Hydro Pump Kyogre still decimates anything you throw it against.