At Duke you'll have to pay for the 3rd year and the MPH. So assuming cost was equal, the real difference would be that it would take 5 years to get the MD/MPH at UNC vs. 4 years at Duke.
Very anecdotal but I've heard there to be a lot of gunner-y/competitive people at UNC (but n=1 and I'm not a current student ofc). Since there's no guarantee that UNC will have any less competitive a vibe than Duke, I would choose higher rank/more national recognition and go to Duke (if the cost is similar).