Fun Fact: In the World of Light opening cutscene, MegaMan is there, but Ryu is nowhere to be found. He's one of the many who wasn't selected to appear. Hard to say why, of course, but MegaMan being higher priority could be a potential thing.
That said, MegaMan was the mascot of Capcom for a while. Capcom Commando didn't last nearly as long as he could've, and Ryu never replaced MegaMan at all. It's really more that MegaMan and Ryu shared the actual spot, being their most successful and known mascots in gaming history.
Mega Man has the virtue of being the third party that appears in the most Smash Advertising. He appears in in:
-Robin's Poster.
-A japanese commercial featuring AKB48 Miis.
-An american 3DS commercial with other characters like Kirby and Mario.
-Bowser Jr.s trailer.
-Ridley's Trailer (the only third party veteran in Ultimate to appear in a newcomer's trailer in CGI form, others appear only in gameplay clips, but not CGI)
-Probably forgetting some other advertising stuff, Tag Me if you know more.
He also was playable in the Smash 3DS demo, something Sonic and Pac-Man cannot say.
Mega Man has the most presence out of all third parties in Smash Bros when it comes to advertising material, and sometimes he's the only third party that shows up. Ryu, despite having games that sell better, beign more influential, etc, Mega Man was the fanbase's favorite back in the pre-Smash Days, and as far as im aware almost nobody brought up Ryu during the Pre-Brawl Days or the Pre-Smash 4 days (although back in the pre-release days of Smash 4, one Third Party per company was a popular fan-rule, so that was mostly the reason most people didn't talk about him)
If there is any character that is analougue to Banjo when it comes to Third Parties, it's Mega Man. He's definetly recognizable and well known, but not super mainstream. He is just mainstream enough because he is seen as a symbol of NES culture. If Mega Man wasn't in Smash and we got Ryu and say, Leon, i would be much more pessimistic about Banjo's prospects as a result.
Mega Man was just more desired by the Smash Community, and Nintendo and Sakurai and Cpacom capitalized on it, Hard. It's proof that you don't have to be super mainstream and the most iconic character in the industry, but instead you have a passionate fanbase that desires you. Ryu, no matter how much important and influential he is (i mean Mario in Smash 64 was the closest thing to a Shoto Clone in that game) Mega Man was the community's choice.