Synchrotron self-Compton emission by relativistic electrons under stochastic acceleration: application to Mrk 421 and Mrk 501