The best way to find a cheap fare is to book your ticket as far in advance as you can and to avoid traveling at rush hour.
This is the last train of the day.
Find all the dates and times for this journey
Trains per day
Of the 6 trains that leave Freiburg im Breisgau for Baden-Baden every day 6 travel direct so it’s quite easy to avoid journeys where you’ll have to change along the way.
Here are some other resources that might have the information you need