Honestly, it's a little late for planning Easter in Andalusia. Semana Santa (Holy Week) is high high season, especially in Seville and Malaga, with several processions every day. Even at the highest prices, many hotels are already booked solid.
Cordoba's celebrations are very low key. There is a very special procession in Granada on Easter morning, so hotel rates for Saturday night are sky high.
From all I've read, Barcelonans who want to enjoy Semana Santa head for other cities since there's nothing at all there, except church services.
As for practical matters, Barcelona is far from Madrid and Andalucia. There are fast trains to Madrid that take about 2 hours. Add another hour to get to/from the train station. If you can't change your plans to fly open-jaw, then it probably makes the most sense to visit at the beginning or end of the trip.
For Andalucia, do a loop from Madrid: Granada/Seville/Cordoba (either direction). They are upgrading the train tracks into Granada, so Renfe (the train company) has a special bus service between the Granada train station and Antequera for the trains to Madrid, Seville, Cordoba etc. There is about 15 minutes to transfer and it's easy. There are also modern tourist-class buses from Granada to those cities, which take about the same time. The difference is that they go from bus station to bus station.
Of all your cities, Madrid is the least interesting. The major draws are the art museums and the Palace. If you skip the museums, 2 days is plenty to get a taste and visit the Palace. There is a very good maritime museum too.