Riolu evolves through friendship, not level. Raise its happiness until it is high, then level it up during the daytime and it will become Lucario.
The in-game hint about the egg you receive points at the same mechanic — the character who hands it over is nudging you toward the friendship requirement rather than a stone or an item.
Fastest ways to build happiness: keep Riolu in your party, feed it vitamins and berries it likes, level it up, and avoid letting it faint. A Soothe Bell helps considerably.