Your definition of a baby Pokemon is totally inaccurate. Baby Pokemon were introduced in gen 2, and BTW Togepi was the first ever obtainable baby Pokemon, and you wanna know what? It was introduced alongside Togetic, just like Riolu was introduced alongside Lucario! Also in sumwuns source(Along with their bullet points), it said,
Baby Pokémon (Japanese: ベイビィポケモン baby Pokémon) are Pokémon at the lowest stage of Pokémon Evolution that cannot themselves breed.
Anyway I hope this helps you understand why Riolu is a baby Pokemon. Also, no source ever said this, but baby Pokemon can’t be legendary.
Source: My common sense, and Bulbapedia