The NBA resonates more with young black athletes than MLB because it is more relatable to black youth who see the league as an extension of their own cultural identity. They have successfully positioned themselves at the intersection of sports and hip hop culture. Hence why black kids want the newest pair of LeBrons and why more of them are playing NBA 2k than MLB the Show.
As JBears mentioned, baseball programs having access to NIL money will make a difference, albeit a small one, but it is unlikely that MLB comes close to the number of black players of the 1980s ever again. The NBA, and to a lesser extent the NFL, passed them up decades ago.