It depends on which ruins you want to visit. There is a ton of things to do in Cozumel without taking the ferry to the mainland (required to see any ruins) so I would suspect that Costa Maya would be a better selection. I would take a ship's tour here just to make sure you get back safe and sound.
Based on what else there is to do on Cozumel and Costa Maya, I would definitely choose to do the ruins in Costa Maya. It is pretty much the only major attraction in Costa Maya where there is lots to do in Cozumel.
Nancy