A medical officers training could be shorter since they already know medicine when they arive at the academy. There, on the other hand, seems to be few prerequisits for regular cadets.
Yeah, I assume that's the same case in the real-world US military, too (but feel free to correct me if I'm wrong). The big difference between mere enlistment and a terminal degree is that if you already have training in your specialty and thus come in more prepared than your usual cadets.
Besides, the US military is always in need of medical professionals anyway, so I would imagine that anyone who joins up but already has the qualifications would get fast-tracked to get them into service quicker, getting trained more in the military culture and lifestyle and the factors that come into play in such circumstances as related to their medical training.
And, at the very least, we've been taught for years that McCoy himself was a medical genius anyway, considering all the times he saved the crew with some last-minute potion in addition to his professional accomplishments. Even if he had to start from the ground up, there's no reason to think that McCoy didn't work his butt off just as much as Kirk at the Academy.