Like all UI interaction widgets, they each have a specific when to use/when not to use.
Sliders are great for selecting or changing values, e.g. from 0 to 10, but they only work well when precision is not needed, e.g. it is fine if the numbers are simple integers (i.e. 1, 2, 3...) however sliders are terrible if you needed to select 17.33. (just think about a volume control - you just make it louder or quieter, but you never set the volume to a specific high precision level).
Radio buttons are for great for quickly selecting a specific thing.Even if you had 20 things, it is just one click to select what you want.
So the real difference between the Radio button and the Slider is actually the interaction cost.
The interaction cost for setting the thing with a radio button is one simple mouse click.
The interaction cost for setting the thing with a slider is much higher - click then drag. Depending on the number of things, the interaction cost goes up, e.g. you are dragging the slider through each drag step to arrive at the one you want, so if you have 10 things, and the one you want is the 10th thing, you need to visit each of the other things using a mouse drag. Mouse drag is more difficult to do than than a mouse-click, and sliding to a thing is slower than clicking the exact thing.