I already went to the traveling agency of Deutsche Bahn, but they told me to book this train online.
What can I do here?
Can I buy a reservation at the train station in Lyon, on the day of departure?
Or how I can get into contact with renfe or sncf for this case?
Please try again at DB; in Germany, that's the best way to get it. They CAN book this train, but sometimes the staff doesn't know how to do it or there's a problem with the connection to the French reservation system.
SNCF can book it but they don't do that on the phone anymore (it was never available online from them) and it will still be a paper reservation. RENFE can also book it but you'd have to collect it in Spain. Booking on the day of departure is a bad idea because the pass user quota for the trains France-Spain is limited and is usually full one or more days in advance.
You can also call DB at 030 2970 (in Germany, the international bookings should also be reachable directly via 030 5512) and ask to collect the reservation from a DB ticket machine (“Bahn-Tix”).
It looks like there are currently still seats available in this train, since I can get to the payment page, so don't wait too long.