You "will have approx 3-5 days" to travel from Cologne to Mainz - correct? And your interests - the starred towns in between - huddle along the river between Koblenz and Bacharach - correct?
There is no ONE pass that covers you for multiple days of travel.
Koblenz-Bacharach is a very short stretch of river. If your plan is to change hotels as you travel south, IMHO this is a lot of work and trouble. I would advise you to book in one town for the most of your visit - St. Goar would be a good logistical choice. On your Travel Day 1, take the train via Koblenz to St.. Goar and drop your bags there...
1.) Following up on Sam's suggestion for weekday travel from Cologne... Buy a VRS ticket to Bonn (7.80 ea.) (not Oberwinter) from any ticket machine in Cologne with a VRS logo. The Rheinland-Pfalz ticket (a day pass) Sam mentions is a good idea - you want to buy that in Cologne as well - but it's valid from Bonn south. (The ticket to Oberwinter would be overkill - it costs 11.40 ea. from Cologne.) Total for two is about 45.00. Leave as early as you like.
2.) If you arrange this trip on Sa or Su instead, you can travel before 9 am with just ONE day pass for the whole day - the Weekend Ticket (44.00/2) and valid for all of Germany.
3.) Why stay in St. Goar: It's only a few minutes by train to Boppard, Oberwesel and Bacharach. Trains run all day and night so you can spend as much time in ANY of these towns as you like. But you sleep in one place and don't have to change rooms or schlepp bags or look for a new hotel. On Day 1 your Weekend ticket (or your Rheinland-Pfalz ticket) is still valid. Use it to explore any place you like by train, hop off and on as you please. I suggest you visit Bacharach on this day. THEN... on Days 2 & 3 and any subsequent days, your weekend ticket is expired. So you buy a local VRM day pass - a mini-group ticket, 22.10/2, at St. Goar station. It's valid for all-day travel (after 9 weekdays, any time on Sa or Su) to Oberwesel, Boppard, Braubach, Koblenz, and dozens of Mosel River towns, and other places too. (It's not valid to Bacharach however, which is why you visited Bacharach after first arrival in St. Goar.) It's also valid on the ferry crossing to St. Goarshausen (where you can catch a train to Braubach, an alternative route to taking the train via Koblenz.) You don't necessarily have to buy the day pass at 22.10/2 - if you are only visiting one town, a simple ticket there and another back may be cheaper. But the day pass allows complete freedom of choice within the VRM zone, hop on/off options all day long.
This is a map of the VRM zone (light green) - http://www.vrminfo.de/fileadmin/data/pdf/2016/Schienenliniennetzplan_2016.pdf
4.) When you are ready to leave St. Goar for your night in Oberwesel, you can make that trip using the same mini-group ticket you are using that day to go other places. You'll need a taxi to reach Auf Schoenburg Hotel - or hike up.
5.) When you are ready to leave for Mainz, you can buy normal DB tickets (13.00 ea. from St. Goar, 12.25 ea. from O'wesel) from a ticket machine. If you want to stop off somewhere en route, like Bacharach again, or Bingen, these tickets allow that.
6.) You can check schedules using all these VRS, VRM, and DB tickets at the DB website. You will need to check the "only local transport" box to find eligible regional trains.
http://reiseauskunft.bahn.de/bin/query.exe/en
Sorry this is so complex. I didn't design it - I'm only the messenger.