To optimize travel for speed, I would recommend high-speed train from major-city to major-city. Then take the local bus to the small town. It your high-speed train trip is longer than 3-4 hours, consider using discount airlines.
All high speed rail in Europe and UK share the same common rail gauge connecting major cities. However, each country, including Spain, has it own legacy rail network network running on incompatible rail gauge. Small towns are often served by older, slower trains on the legacy rail network, running about the same speed as the local bus.
The smaller towns are in the process of connecting to high speed rail, but these projects run at glacier speed. For example, Burgos Spain of 200,000 people was only recently connected to high-speed rail from Madrid, requiring new train tracks and a new train station to support high-speed trains.
In Spain, “AVE” and “Alvia” are high-speed trains. There are high-speed rail map available to help plan the best route.
-Paul