RO water purifiers are best for hard water or where TDS levels are very high. While UV water purifiers are best suited for purifying municipal water or tap water and with low TDS levels.
Another factor is RO water purifier helps in removing heavy metals and toxins, whereas UV water purifiers are incapable of doing that.
Depending on the hardness, TDS, and PH level of water, the water purifier should be selected.