Yes, but the engineering would be tricky.
Even getting to 30km/s is tricky. Current experimental railguns only manage between 2 and 3 km/s. A large part of that is due to limitations on the power supply and barrel length for practical weaponry applications (which are exactly the things you are looking at changing), but not all of it; even lower-powered railguns experience problems with rail erosion and electro-welding, which will seriously screw up an engine!
To solve those issues, you'll want to go with a coilgun (or "gauss gun") instead. I am not aware of any large-scale coilguns having actually been built; they are considerably more complex than railguns, as they require careful synchronization of different accelerator components. Small-scale coilguns, of the kind that a dedicated hobbyist could build in a garage, avoid the problem of electro-welding, but will still have to deal with frictional heating and barrel erosion. Fortunately, however, it seems that a large-scale coilgun can be designed to naturally center the projectile through magnetic levitation. While this sort of military-grade coil gun is currently only designed to hit around 3km/s in atmosphere, there is no fundamental reason why it could not be scaled up to arbitrarily high muzzle/exhaust velocities when operating in vacuum, as long as you ensure that the projectile never actually contacts the barrel walls. "All" you have to do is make sure that the wave of accelerator coil activations accelerates slightly ahead of the projectile for the whole length of the barrel, and that the barrel infrastructure can support the reaction forces. Since the force on the projectile need not increase with a larger length, it should be possible to extend the barrel indefinitely with only a linear increase in structural mass. Additionally, the mass of the barrel infrastructure can be kept down by simply putting a cap on the maximum mass of a single projectile (thus capping the force required to accelerate it)[*], and 95km/s is well below the speed at which electrical control signals can be sent along the barrel.
In practice, unless you have extremely good quality control on the inputs to your mass driver, you will not want to use a single centralized control system; the acceleration profile of each projectile will likely be slightly different, so you will want lidar sensors (or something equivalent) distributed along the barrel to measure the projectile's actual progress and trigger successive accelerator coils locally.
There is also the issue of bucket/sabot recovery. If you want all components of the drive to be reusable, and you want to be able to just dump whatever mass you have on hand into it as remass without pre-processing, then
- You need an accelerable bucket to carry the arbitrary mass in, as you can't depend on the remass itself to have the necessary magnetic properties.
- You can't throw the bucket away.
If you are OK with carrying some dedicated "fuel mass" and just augmenting it with arbitrary stuff, then you can throw away your sabots, and things become simpler. A similar situation applies if you have onboard facilities to refine mined materials into sabots--but then you can't just use whatever you find willy-nilly, and you have the added complication of the refinement and manufacturing facilities.
So, how do you go about recovering the bucket(s)? Well, for one thing, you know that an empty bucket obviously has less mass than a bucket full of remass, so you can decelerate it much more quickly given the same amount of force--and since the deceleration stage will put the barrel under tension, you can use a much higher deceleration force! That means that bucket recovery will not take up half the length of the barrel; 10% or even less would be plausible, and the size of the deceleration section will scale linearly with the rest of the driver. The tricky bit will be actually catching the buckets at the end and returning them for re-use. I am not at all sure how to arrange that infrastructure in a way that leaves an opening for the remass to pass through and does not add a bunch of moving parts that are then prone to potential failure.
[*] You can save even more mass by arranging the mass driver in a tractor configuration, with the barrel extending in front and the bulk of the ship arranged around the nozzle. This will put the whole thing in tension, and structural metals tend to be much stronger in tension than in compression (if you are building the barrel out of asteroidal rock, on the other hand, that would be a bad idea, as rock is much stronger in compression). If you arrange things carefully, you can make sure the deceleration section is also in tension, but if that becomes impractical, take comfort in the fact that the bucket deceleration section is relatively tiny anyway, so you still get a net mass savings.