I agree with the points being made here. The NBA and NFL present a much greater chance of being paid right away than MLB does, the latter being more of a long term play (and no guarantee you'll play in the majors long enough to ever truly cash out). It's also easier to toil in the minors for years if you grew up in an upper middle class or better family, so combine that with the cost it takes to play baseball as a youth compared to just buying a basketball/football and going to a park, and those factors definitely contribute to the drop in black players over the years. I think marketing the game/players better will help a lot though. If black kids see Judge, Betts, and others marketed on social media like crazy, and suddenly it becomes cool to play baseball again, then you might see more kids pursue it.
Either way, I don't think baseball has a race issue when it comes to players. It's the marketing of the sport that needs work. If anything, the racial breakdown in MLB is likely superior to any other sport in North America. It just has seen a decline in African Americans over the past 30 years, something they are at least trying to remedy, which is more than any other sport would do to improve a demographic.