Maximize energy, minimize momentum
Recoil is a function of the momentum of a fired round, and is proportional to mass and velocity of the projectile. Kinetic energy of the projectile, on the other hand, is proportional to mass and velocity squared. For a conventional firearm, the expansion rate of combusting gases puts a limit on practical muzzle velocities. But a railgun can effectively convert electrical energy directly into kinetic energy (with losses), and has no such limitation.
So, the solution is simple: Use a very light round, and maximize its muzzle velocity while minimizing its mass. A typical 7.62x51mm rifle load fires a 10g projectile at a velocity of 833m/s, and represents a practical upper limit for rifle recoil. Scale down the projectile size to 2.5g, and the velocity up to 3,332m/s, and the momentum remains the same while the muzzle energy increases by a factor of four.
This is a very light round, about as massive as a .22LR, so it may have difficulty retaining energy at range. But its sheer velocity more than makes up for it, as it now has a maximum muzzle energy of over thirteen kilojoules. The main problem now is that fast-but-light rounds have a tendency to overpenetrate (pass through the target rather than transferring their energy), but we have a solution for that too.
(Edit- A commenter has pointed out that hypervelocity impacts behave differently from conventional ballistics, so overpenetration may not be an issue. A micrometeorite impact does seem like a good analogy for this tiny, high-speed bullet.)
Adjust your firing parameters
Simply adjust the muzzle energy for the given task. At long range, use the full-power shot to get a flat trajectory and maximize accuracy. Against armored targets, also use the full-power shot to maximize armor penetration.
But at short range, against unarmored or lightly-armored targets, you can step down the muzzle energy and step up the rate of fire. If the example from before is stepped back down to 417m/s, each projectile has 1/64 the muzzle energy of the full-power round, and has mass and velocity comparable to a .22LR. That's not very impressive, but you can now increase your rate of fire by a factor of 64, while still drawing just as much power as before from your power source.
Note that overall recoil will increase by a factor of 8, but since each individual shot will have much less recoil it will be more of a strong push than a bone-shattering shock. For reference, the American-180 submachine gun had a rate of fire of 20 rounds per second and is extremely easy to control. A much higher rate of fire should be practical in a rifle configuration.
But there's one more trick we can do.
Brace the rifle
A bipod will help immensely. Weapons as large as 20mm anti-tank rifles are manageable with a bipod and suitably padded buttstock, and this is the common configuration for light machine guns. A rifle with 7.62 recoil like I described may be difficult to handle on full-auto from a standing position, but a machine gun in the same caliber can be comfortably fired in accurate bursts.
But if possible, set the rifle down on a dedicated tripod mount. Now that same machine gun can accurately fire on full-auto as fast as the weapon's mechanism can sustain with no recoil imparted on the shooter. Your weapon's firepower is now only limited by what the recoil system of the tripod can handle.
Even a simple metal tripod with no special recoil system can sustain far greater recoil than the operator's shoulder and will allow us to scale up the muzzle velocity, rate of fire, or both as needed. Design a suitably portable tripod, and every rifleman in your army can have the firepower of an MMG combined with an anti-material rifle combined with the world's angriest submachine gun at his disposal.
Your challenge is figuring out how to carry enough ammo.