What is stopping a Electromagnetic rail gun to propel a body in space? Why are railguns not used to for propulsion is it due to the air resistance?
IMP-If we were to provide some propellant to the body inside the rail gun to be used after leaving the nozzle of the rail gun will it reach space?

 A: Air resistance is indeed a big part of it: low earth orbit speed is about 7km/s, and if you do that airspeed at sea level you will very quickly slow down while simultaneously catching fire and exploding.
A second big problem is acceleration: reaching 7km/s at 5g (not all humans can remain conscious at this acceleration) takes $$v/a = t ≈ 143s$$ which means that to be rated for human spaceflight your railgun has to have a length of $$d = \frac{1}{2} at^2 ≈ 501km $$
Which on the one hand solves the air resistance problem by being so long that one end can be outside of the atmosphere even while the other end is resting on the ground, but also brings with it a new problem of "we can't build stuff that big".
You can have a much shorter barrel if you're launching cargo that doesn't care about hard acceleration, so this could be useful on — for example — the Moon, but the barrel is still 2.4km long if you want to reach 7km/s at 1000g of acceleration.
If you're trying to reach orbit rather than escape velocity, you also have to go sideways, so you'd still need an on-board engine no matter what size and power of railgun you use, just because the whole thing can't be perfectly horizontal unless you also build (at least one) tower which reaches into space.
