We plan on visiting Bacharach, Oberwesel, St Goar, Boppard, Koblenz, as well as crossing over to Ruedesheim.
There are no train tickets to purchase in advance. Oberwesel, St. Goar, Boppard and Koblenz all lie within the VRM transit authority. Hopefully you are staying within this VRM zone (see map below.) You can get a VRM mini-group day pass that covers all the trains to these towns as well as several other towns on the Mosel River, on the Rhine north of Koblenz, and certain towns south of Koblenz on the east bank (like BRAUBACH, the home of Marksburg Castle and conspicuously absent from your list!) An individual pass covering 3 days of travel is also available from VRM. Pick up tickets at a ticket machine at the station.
Here's a map of the VRM zone: https://www.vrminfo.de/fileadmin/data/pdf/2015/Schienennetzplan.pdf
Note that if you stay in BOPPARD you have no tickets to buy at all; your innkeeper will provide you with a FREE guest card for FREE train travel throughout the VRM!
Rüdesheim, Bacharach and Bingen (in case you are starting a river cruise there) lie outside the VRM and are not covered by VRM tickets. So you may want to use a Rheinland-Pfalz day pass for getting to these places (no 3-day version is possible.) Buy it from a ticket machine as well.