It might work well to take the train from Frankfurt to Heidelberg to Stuttgart, pick up a rental car in Stuttgart, drive to Strasbourg, and drive back to Frankfurt. Here's why:
If you book NOW at www.bahn.de, you can get a Sparpreis fare as low as 19 euro for Frankfurt-Stuttgart, including a stopover in Heidelberg. Sparpreis tickets are for specific departure dates and times and are non-refundable and non-exchangeable.
Go to the site and click on the drop-down flag menu for English. Enter Frankfurt(Main) as your departure point, a departure time, and Stuttgart Hbf as your arrival point. Choose the number of passengers and then click on "Further options." On the new page enter Heidelberg in the "Via" field and select the number of hours you wish for your stopover there. Then click on "Search." You'll be given a number of departure times. In the Savings fare column click on "Check availability" for your preferred departure time or click on "Check all." Proceed with booking the time of your choice and print your own tickets.
There is no relatively direct train route from Stuttgart to Strasbourg. You would make a minimum of three connections and the trip would take around eight hours.
According to viamichelin.com, driving time would be around two hours.