Lepton-pair production in association with a $b\bar{b}$ pair and the determination of the $W$ boson mass