You could try redirectingtransferring the recoil, like they do with the Kriss Vector rifles, which uses a unique method of taking most of the recoil energy and sending it down, then back up, instead of back toward the shooter.
From the video, you get a little bit of back, then a sharp down and then a sharp up. Obviously this is a traditional powder gun, and not a railgun, BUT you may be able to do something similar with a railgun by having the recoil push the barrel back, and use that action to drive something down, moving the energy in another direction.
EDIT:
Found a gif of the mechanism in action to show how it works