Is this a new problem or one you're just now noticing? Does it happen with all your mags or just one? If you can, try a brand new Ruger mag. If you still have the problem, it's with your gun. You may have some grit or crud in your mag release. Unfortunately, Ruger has a habit of poor quality control and failure to clean the machining grit out of their guns. Unless you're adventurous and mechanically handy, I'd suggest giving Ruger a call. But if you're familiar with working on guns, the mag release is not very difficult to remove. Once it's almost or completely out, your problem should be fairly obvious.
Good luck and if you want to see a complete teardown SR9 video, I'm sure you can find something on YouTube.