If it's only two colors and two sliders you want, you can recreate the Color Ramp with a Map Range node and a Mix RGB node.
Set the From Minimum value to the position of the left slider and the From Maximum value to the position of the right slider. Leave To Min and To Max at 0 and 1. Plug the result into the Fac input of the Mix RGB node and set the first color to the left slider's color and the second to the right slider's color.
In this example the left slider is red at 0.25 and the right one is yellow at 0.45, the left sphere uses the Color Ramp material, the right sphere the Map Range material:

I'm sure you could build even more complex setups to recreate more than two sliders and maybe even different interpolation modes (since Map Range also has more than just Linear).
Speaking of interpolation modes, if you want to keep the options of interpolation from the Color Ramp like Linear, Ease, B-Spline, Constant, you can still use the ramp but "expand" it a little bit.
You take a Color Ramp with black and white and plug it into the Fac input of a Mix RGB node. Then you add two Value nodes in the material, you don't have to connect them to anything. Just right-click one of the values and choose Copy as New Driver. Place your mouse over the position value of one slider, right-click and choose Paste Driver. Now repeat that for the second Value node and the other slider.
