We are seniors traveling from Barcelona to Malaga by train, is it better to book/buy tickets in advance before we leave canada or buy at the station. Is it cheaper for seniors at the station to buy at the stations? Should we buy standard tickets or upgrade?
I heartily recommend having a look through this railway "primer" for Spain:
https://www.seat61.com/Spain-trains.htm
It explains the pricing - in your case getting the OAP gold card may not be worth it for one journey since you can book in advance to get a cheaper Promo fare. It also explains what extra you get going 1st class (called Preferente) -including a meal on some services, but not all. The 2nd class seats are comfortable enough for shorter journeys of a few hours, in my opinion.
What it won't explain, of course, is that between Barcelona and Malaga it might well be faster and cheaper to fly (assuming you know your travel date).
I have no idea how many trains I've taken in Europe--certainly over 100, maybe over 200. I have never bought a first-class ticket. On the few occasions when I've needed to walk through a first-class carriage to reach my seat, it has been very, very uncrowded. Obviously, most other travelers agree that the extra cost is generally unnecessary. If you are traveling during a really busy period and have a problematic amount of luggage, however, you might appreciate the probably-less-crowded luggage racks in the first-class car.