"It looks like it's a nice hike up to Rheinfels Castle..."
It's fairly short. You can take the sidewalk along the access road (Schloßberg) or find a trail. The nicer, easier trail is a longer route kinda through the woods. It begins at the train station... find the thin, squiggly white line that crosses under the tracks just to the right of the station on this map of St. Goar and zoom in:
https://www.st-goar.de/files/stadtplan-st-goar.pdf
Follow the white line, the "R" symbol toward the upper right corner of the map until it empties onto "Gut Rheinfels", a small residential area opposite the castle, which is just across the access road.
"Any other recommended walks along the Rhine?"
One of my absolute favorites is the hike to Oberwesel along the clifftops. Use that same access trail at the station but keep left and take a steep climb uphill to the clifftop like you're headed to Biebernheim... but make a left onto the trail that heads to "Aussichtspunkt Kretschhütte", a viewpoint with a wooden structure, instead. Nice view here - but keep on following that trail south along the cliffs and through pasture and woods and to more little view points, and you'll eventually reach vineyards and Oberwesel:
https://www.outdooractive.com/api/staticmap?i=8624244&size=large&project=outdooractive
The Günderodehaus is a nice place to pull into before you reach Oberwesel. I think it requires a short detour from the main trail. The building was part of the film set for a very famous TV series called "Heimat" but I think it would be popular even without that notariety.
This woman did the hike in the opposite direction and took some photos that will give you an idea:
http://frau-k-wandert-durchs-saarland.blogspot.com/2015/05/rheinburgenweg-etappe-10-von-oberwesel.html
You can take the train back from Oberwesel to St. Goar in 5 minutes.
Yes, you can see Marksburg from the opposite side of the river from the train you will use to travel to Cochem. Should look like this minus the bikers. But the view is a small joy compared with a tour. It's a great castle.