A new rail track that bypasses Madrid means that you can now travel by train from Barcelona to Malaga without going via the capital, according to this article on Typically Spanish: High speed rail link opens between Malaga and Barcelona.
The new journey takes just five hours and forty minutes - an impressive time considering how much distance you are covering. However, tickets aren't cheap. If you book well in advance and online, a round trip costs 160€ - you'd be better off flying. Going by plane would be a little quicker too, even taking into account check-in times and all that waiting around you get at airports.
Book Train Tickets in Spain
Compare Prices on Flights in Spain (book direct)


“you’d be better off flying”
Unless you don’t like flying, like me.