The ability of Groudon will be activated when it is sent second in battle.
E.G.:
1. Kyogre was sent out, rain started, Groudon was sent out, rain will stop and sunny day will start.
2. Groudon was sent out, sunny day started, Kyogre was sent out, sunny day stoped and rain started.
So, the one that is sent out second, it's ability will be activated.
If Kyogre was sent out second and rain started, send out another pokemon and then Groudon again, sunny day will start. If you want for rain to continue, do it vice versa.
I think this is fully answered.