there are trains from Paris to Madrid
10:10 Paris(montpamasse) > 15:40 Irun , 17:05 Irun > 22:44 Madrid(Chamartin)
15:50 Paris(montpamasse) > 21:25 Irun , 22:15 Irun > 07:35 Madrid(Chamartin) (Night Train)
19:43 Paris(montpamasse) > 09:13 Madrid(Chamartin) (Night Train)
P.S. The Departure of the train may be delay
Don't make your timetable being tight
Night train is good option for this
but don't buy the seats
it will always disturb your sleeping ( light and comfort of seat)
Sleeping car(+50%) and Couchette (15-20%)is better for night train
europass is not suitable for you travel inside the country
you can buy your ticket directly in the station
it is less expensive than europass
For you want to travel country to country
Europass may be cheaper (but not too much)