The IC50 (inhibitory constant, a measure of sufficiency of plasma concentration to inhibit 50% of affected biological processes [how I'll estimate potency]) of caffeine in the human model is estimated at a concentration of about 67microMolar. Cocaine's IC50 appears to be about 4.4mM.[4]
The major difference in routes of administration will be how much of the substance ends up in plasma vs metabolites. Making the genuinely wild assumption that they have similar plasma effects from the same RoA, it would appear the IC50 of cocaine is about an order magnitude lower than that of caffeine (meaning you need less), while its LD50 is about a third that of caffeine (meaning less will kill you [but also keeping in mind that the LD50 was found via injections]) but still within the same order of magnitude approximation.
This to me indicates that cocaine is the preferable compound, even though I still think neither of them is great intransally. I will say, however, I absolutely prefer my cocaine as a drink and caffeine as a snifter. I have an intranasal cocktail of oxytocin, kanna, and caffeine that I'll bump once or twice a week. I quite like it, but people who rail lines of caffeine simply befuddle me.
[1] https://pubmed.ncbi.nlm.nih.gov/7178201/
[2] https://pubmed.ncbi.nlm.nih.gov/27461039/
[3] https://jnm.snmjournals.org/content/jnumed/early/2012/09/07/...