As with all Pokémon games, Groudon will re-appear after you beat the Elite Four. Even if you accidentally defeat him again, simply beat the E4 again and Groudon will reapear. Try saving before fighting Groudon, and then restarting if you knock him out.