(Abridged) Eclipsing, spectroscopic double-lined binary star systems (SB2) are excellent laboratories for calibrating theories of stellar interior structure and evolution. We aim to investigate the mass discrepancy in binary stars. We study the effect of near-core mixing on the mass of the convective core of the stars and interpret the results in the context of the mass discrepancy. Two scenarios are considered, where individual stellar components of a binary system are treated independent of each other and where they are forced to have the same age and initial chemical composition. We find that the mass discrepancy is present in our sample and that it is anti-correlated with the surface gravity of the star. No correlations are found with other fundamental and atmospheric parameters, including the stellar mass. The mass discrepancy can be partially accounted for by increasing the amount of near-core mixing in stellar evolution models. We also find that ignoring the microturbulent velocity and turbulent pressure in stellar atmosphere models of hot evolved stars results in overestimation of their effective temperature by up to 8%. Together with enhanced near-core mixing, this can almost entirely account for the 30% mass discrepancy found for the evolved primary component of V380 Cyg. We find a strong link between the mass discrepancy and the convective core mass. The mass discrepancy can be solved by considering the combined effect of extra near-core boundary mixing and consistent treatment in the spectrum analysis of hot evolved stars. Our binary modelling results in convective core masses between 17 and 35% of the stellar mass, in excellent agreement with results from gravity-mode asteroseismology of single stars. This implies larger helium core masses near the end of the main sequence than anticipated so far.