Here's how I'd organize things to include your goals there.
Day 1
From Frankfurt HBF catch the direct Regional Express train (9:08) train north to Boppard (10:38.) Leave bags at hotel desk. See town briefly, grab a bite. Board 12:50 KD cruise boat to Braubach (13:20 - easiest way of several to get there, about €6.50 discounted fare) and tour Marksburg. Leave Braubach at 15:53 and get back to Boppard in about 1 hour with a change in Koblenz. Or linger in Braubach and the 17:23 train returns you to Boppard (18:07) also via Koblenz.
Day 2
Catch train south to Bingen, ferry across to Rüdesheim (ferries run all day from Bingen river promenade - €2 each.)
R'heim and chair lift w/ lunch
Cruise north on 14:15 boat from Rüdesheim. Stopover for two hours in Bacharach or Oberwesel and continue north on the final boat of the day. OR... better yet... for more flexibility, stay on the boat beyond O'wesel and B'rach to St. Goar (15:55) to complete your scenic boat ride, and then just take the train south to Oberwesel and/or Bacharach (5 min and 10 min. by train respectively.) Trains connect these towns every hour or better in each direction, making it much easier to go where you want when you're ready. Then return to Boppard whenever. It's only a few minutes by train.
For Days 1 & 2 you will want to have the Rheinland-Pfalz ticket (daypass, €27/2 adults,) a cheap and convenient way to do (almost) all your train rides and for discounts on the KD cruise fares (20%) You can buy the R-P ticket at Frankfurt Hbf for both days if you like or at any train station. The R-P is good after 9 am weekdays for the regional trains - don't hop on any IC, ICE or EC trains.
For Day 1 you will also need a standard RMV (local transit authority) ticket for the RE train between Frankfurt Hbf and Mainz - the first segment of your train travel and one not covered by the R-P ticket. It costs €7.80 each from a Frankfurt Hbf ticket machine. After a stop in Mainz your RE train from Frankfurt heads toward Boppard, at which point your R-P ticket kicks in.
Trip to Cologne
Linz am Rhein is maybe the most attractive old town between Cologne and Mainz. Take the train there with a change in Koblenz. From there you can proceed to Cologne by train or take the KD cruise boat to Bonn, then the train onward from there. No lockers in Linz but it is possible to leave bags at the station eatery called the "Alter Wartesaal" (Old Waiting Room) M-F from 6:00 to 18:00, according to the Linz town website.