As the first biographical history book, Historical Records, as the first chronological general history book, appeared in the Song Dynasty, further improving the position of Historical Records in history. However, after the Jin Dynasty and even the Tang Dynasty, Shi Lu, a historical book, became popular because of its more authentic biographical way, so biographical style had no advantage at all in the Tang Dynasty.
But for this kind of thing, I think it is only possible that the two historical books have different emphases, but it is definitely not because of what happened between Sima Qian and the Li family. Because Hanshu describes the Li family more than Shiji, and Li Ling's conviction was directly overturned in Hanshu, but Sima Qian's surrender to Liling is impossible to know, so there are many positive descriptions of the Li family in Shiji.
As for the problem itself, the status of Sima Qian and Ban Gu actually changed in different dynasties. After all, due to the different historical materials respected by each dynasty, the understanding and evaluation of them will also change differently in each dynasty. I think it is fair to analyze these two people comprehensively and objectively.