There is no train from Madrid to Castelo Branco.
There is a train from Madrid to Badajoz but you would have difficulty getting from Badajoz to Idanha-a-novo.
The festival organisers do offer buses from Madrid and Lisbon Airports.
See: http://bit.ly/cHU6d7
Also see my recent comments here: http://bit.ly/ayPd2E
Getting to Castelo Branco from Faro would not be impossible.
You would need to get a bus or cab into Faro Bus Station. Then a Rede Expressos bus, some of which would require a bus change at the Sete Rios Bus Station in Lisbon. Transit time would be between 7 and 8 hours.
I have published and extract from the relevant timetable here:
http://scr.bi/9KUDnL