Yes, you can catch them again
As with most legendary Pokemon, if you faint the Pokemon when you could've caught it, you must beat the Elite 4, then they will respawn in the same locations as before, and you can catch them since you fainted them the first time, however, be warned as they will now appear at level 65, instead of 45, like their in game encounters.
You must beat the Elite 4 though, so if you haven't fought the E4 yet, you must before they will respawn
This also applies to running away from them.
Source: Looking at the answers for other questions like this with other legendaries, as well at looking at Cobalion, Virizon, and Terrakion pages to find out if they move, and at what level they are when they respawn.