Hi Mary, There are very few trains to Girvan, most services begin in Glasgow although there is a link from Kilmarnock to Ayr which takes you onto the same line.
I think that firstly you really need to check the rail timetable very closely. I would seriously consider staying in Glasgow overnight. The reason for this is that with the foot and mouth restrictions which are in place right now, the distance you propose travelling, and your limited time available, you may find this a better option. Also I would advise you to keep up to date on whether the festival is (nearer the time) actually on or not. Foot and Mouth has jumped another 25/30 miles West today into Wigtownshire. If this goes on I can't see the festival surviving, this is a big agricultural area.
I would normally say stay in Dumfries or Ayr but all things considered you'll find more things open in Glasgow and it'll be an easier journey down to Girvan. Hopefully I'll get to meet you in the Queens it's a great little festival and you'll love it if it's on
All the best,