Your two choices aren't really comparable.
Heidelberg = pleasant city of modest size, about 2 hours round trip travel
Rothenburg = very atmospheric old-world town but very touristy, 5-6 hours of train travel.
It's unclear to me why these two are your only options. GELNHAUSEN is only 1:10 round trip from Frankfurt by direct train. The old walled town of BUEDINGEN is a fine alternative to the theme-park feel of Rothenburg and only about 15 minutes beyond Gelnhausen. You could do a two-fer in a single day trip.
MAINZ, a university town, is an unheralded place on the Rhine River with a nice pedestrianized old town zone, not terribly different from Heidelberg in size and charm, and with several good sights - and it's less than 1.5 hours from Frankfurt round trip.