Take the train. On this route, it beats driving on both time and money.
The journey is about 1h 51m faster (1h 55m by train vs 3h 46m by car) and roughly $51 (€41) cheaper once you factor in fuel and tolls ($23 (€18) vs $74 (€60)). You'll also arrive in the city centre rather than hunting for parking, and you can work, read, or watch the landscape go by instead of concentrating on the road.
Direct services run with iryo, Ouigo Spain, SNCF OUIGO.
Driving is still worth considering if you want to stop along the way or need a car once you arrive.