I have since figured out what has happened, and it wasn't that. Yeah, I did know that single ability pokemon have a 50% chance of either ability when evolving, but the problem is that Riolu is NOT a single ability pokemon. Riolu can have the Steadfast ability, so by your own source, it should have stayed the same upon evolution.
The problem was that I got that Riolu in a trade (because I was not yet able to breed my own with the egg moves I wanted). Apparently, rather than having bred it himself, the guy I traded with just created a hacked one with pokegen. However there are two parts for ability; the ability itself (which overrides the other part), and the ability value, which can be set to 1 or 2 for whichever ability is selected. Since they can be set independently, he must have forgot to set the value to 2 for inner focus, causing the ability to be reset to steadfast (value 1) during evolution. If he hadn't overlooked that, I probably never would have found out, as it seemed totally legit otherwise.
Since I really don't want to use it now, I guess I'll just wait and breed one myself later (which will be a pain in the ass because in order to get egg moves on it, I'll have to find a rare female Riolu). Thanks for your response though!