Badami (BDM) is the nearest railway station for Pattadakal and Aihole. There are a few daily and weelky trains from Bangalore to Badami.
For some trains stop is at Bagalkot (BGK) which is about 25km north of Badami.
The best option is the Gol Gumbaz Express (Train No:16535) that leaves Bangalore by evening and reaches Badami in the morning.
The second direct train from Bangalore to Badami is the Yesvantpur Barmar AC Express (Train No: 14805) Though its a weekly once (Mondays) train and reaches Badami in late night.
Alternatively, if you are willing to break the journey in two, book in one of those Hubli (UBL) bound trains from Bangalore. Get down at Gadag Jn (GDG). There are many trains passing through Gadag towards Bagalkot (BGK) via Badami, Including a few passenger trains.
Checkout also your options to travel Bangalore to Badami by bus.
Mysore-Sainagar Shirdi Express
Yesvantpur Barmar AC Express
Gol Gumbaz Express
Also see the irctc.co.in website for updated and train timings.
Train Route Map for Badami, Pattadakal and Aihole. Badami is the nearest railway station
See Also : How to Reach Pattadakal
Galaganatha Temple dedicated to lord Shiva is a compact yet strikingly unique temple in Pattadakal. The most striking part of the Galaganatha Temple is its dexterously executed tower and the fluted final atop. Most likely the Galaganatha Temple was built around 750 CE during the regime of the early Chalukya king Vikramaditya II.
Lord Shiva slaying Andhakasura, the blind demon, is a popular mythological theme carved on many Shiva Temples. At Pattadakal you can see a giant image in the south side of the Galaganatha Temple. The story goes like this. While in the mount Mandhara a baby was born to Parvati and Shiva. Shiva was in a meditating posture and Parvati closed his eyes mischievously from behind. The boy appeared out of Parvati's sweat. Shiva explains to Parvati that since his eyes were closed, the baby was born blind and calls him Andhaka (the blind). Since he posed devilish qualities he was called Andhakasura (the blind demon ).
Pattadakal (Pattadakallu in local language ) in the Indian state of Karnataka is renowned for the group of the 8th century CE monuments. Pattadakal is a UNESCO World Heritage Site.