What I have done in the past is use high strand count test lead wire bundled into a mesh sheath. Something like 65 / 36 stranded 18 Gauge wire. 65/36 means 65 strands of 36 gauge wire, making an 18 gauge conductor. Belden #8897 for example.
The bundle is then allowed to lay in a tray along the axis of motion, and simply come back onto itself or layout in its full length as the sensor moves back and forth. The tray can be a length of Panduit wire channel, or something similar.
There a specific cables made just for this application, but they tend to be expensive, or hard to get in short lengths.
Using power rails tends to be a bit of a nightmare for low level signals, and as with anything mechanical, requires maintenance. Reliable rail systems, and precision slip rings, are not cheap.
Belden makes a high flex cable for this type of use, it's #7403a or a full shielded version #7403as.
If you have the room, you can hang the wire down from above, midway along the length of travel, then allow it to pendulum back and forth with the sensors movement. Coiled cord works well for this since it can take up some of its own slack and help prevent tangling.