bummer...
sounds like something has to give. Marriage. Baby. Career.
I think you need to put your career first. Sounds cold, children are everything, yada yada.
Careers are a plan for now until age 67 or retirement or disability. Children aren't legally beholden to you past 18, beyond that there's no guarantee they haven't decided they hate your guts and will never speak to you again. Spouses have the shelf life of perishable stinky cheese, and you sadly have very little control over how much they try to ruin your relationship with your children.
You could pass up med school, move to whatever state(s) she moves to in the next 18 years to be nearby, and 8 years from now she might manage to move to England to be with her online fiance and take the kid with her.
If you prioritize your career now, you will be in a better place 7 years from now, depending on how you plan things, to be right where your child is, with resources and if you take a big pay cut, still ample time and money to make the most of your child's remaining childhood (and avoid the scenario where they want nothing to do with you. Hint, this is more likely if you subject them to an unhappy marriage or they get it in their heads your failed marriage and career are their fault, no matter what you say).
Is it the Brady Bunch plan to plan to swoop in later? No, but a marriage falling apart isn't either.
My first dad was in and out of my life up until I was 7 years old, and man, it doesn't take much time to make a big impression at that age. I loved him, I really did. The domestic violence and verbal abuse and fights and family drama going on around me? Still living those impressions down too.
The man that actually raised me, that I wish I had some Shakespearean words to describe how dear he is to me, didn't come into the picture until later.
Point is, early chaos and nearby abuse will scar this child. People wonder what bond they'll make with a kid though, if they're only getting some visits, weekends, summers, when they're young. If you do it right and mindfully, a strong and positive one. How much catching up can you do past that time? A lot.
I just worry, if you sacrifice career, you will end up with nothing. No marriage, career, or even good relationship with your child to show for it.
Ultimately you know all the variables and can make the best decision. Just remember, your career is the one thing you have that you use to support YOU, and you have to take care of you to take care of others.
People think they'll have a spouse, kids, family, waiting for them if they don't have career, lose their jobs, their health. That's great when other people play along. When they don't? Better to be the one everyone turns to.