Well, I agree with the fact that Riku isnt as good in magic as Sora, but the point is, again, he is a better keyblade user.
As we have seen so far in the series, Sora had used the keyblade for a longer period of time than both Riku and Roxas, yet his swordsmanship is still behind Riku and Roxas.
We can see that even though Roxas was "born" after Sora used the keyblade for months, Roxas definitely is a better blade user when it comes to speed, skills, strength and blade handling. Sora's magic abilities is just a cover-up for his lack of skills in those criterias. Roxas's defeat was not because of his lack of skills at all.
On the other hand, Riku (despite the fact that he doesnt have too many spells), can use the keyblade even though he is not the "chosen one" or a nobody of the chosen one. He does not fear the darkness and his basic sword handling skills are just way better than Sora.