the limiting factor for the most part is the CD medium itself and not the mastering.
On the other hand, vinyl is merely -capable- of achieving great sound. The consistency of the audio quality of vinyl ranges from worse-than-CD to mind blowing.
Hmm. I have an LP mastering system and a CD mastering system. I'm probably arguing nuances, but FWIW here are my experiences. The biggest limitation in CD is indeed in the media itself and not the mastering.
The same is not true of the LP. Here, the limitation has to do with the arm and cartridge. The mastering side of the LP is by any comparison the most unlimited thing in audio. LP cutters can do things in terms of dynamic range that are simply not possible with any other part of the audio system except for perhaps a microphone.
It is the limitations of playback that define how the LP is to be cut, not the limitations of the cutter. And the limitation of the LP has to do with the ability of the arm/cartridge to reproduce what is in the groove. The cutter itself, and the resulting vinyl, has abilities way beyond any digital system. But the cartridges and tone arms do have limitations and it is those limitations that the mastering engineer has to be cognizant of; this is the difference between a good LP and an excellent one.