I could imagine Google being smart enough to have some tracking between duplicates. If you include a link to your main blog on Medium perhaps it may understand "pages A and B have the same main content, but A contains an additional link to B so B is probably the true source".
Google quite reasonably now sees duplicate identical content as an issue, you can use the "canonical" HTML tag can be used to help it see the "real" link where several exist.
I don't know what'll happen when there are only two copies of your page, but I'd hazard a guess it'll preference medium's domain over your own in most cases.