If you are an experienced traveler, I think it will be fine.
Consider the pace.
Why Valencia?
When I visited Barcelona long ago, there was a local Spanish chain version of a sub shop and their baguette sandwiches were delicious.
It might have been this.
https://www.pansandcompany.com/en/products/sandwiches/
Pack lightly and consider getting a rental in the 2nd or 3rd city that has a washer/dryer in case you need to refresh key pieces.
Make your train reservations for times that allow a lot of margin for error. AM instead of after dinner.
The train landscape between Barcelona and Madrid isn't highly scenic but there are occasional old towns to see from afar.