You might want to look at this link:
United States Coast Guard Academy - Cadet Life: Advanced Degree Programs
I'm not sure about medical school, but after an initial assignment at sea or in a land based command, many junior officers (lots of whom are Academy graduates) have the opportunity to apply for graduate study at government expense.
Here's a quote from the site: "Every junior officer in the Coast Guard can apply for the opportunity to obtain advanced education at Coast Guard expense. These educational programs generally range from 12-24 months in length and come with an additional service obligation of three months for each month of education for the first year and then a one-for-one after the first year of education received. There is an excellent chance of going to a post-graduate institution of your choice, as long as the university offers the degree program for which you have been selected.
While in school, you continue to receive full pay and benefits - your only job is to study and earn your degree!"