The train route from Bangalore to Palani is same as Bangalore to Madurai . On the madurai route get down at Dindigul Jn. There are a few passenger trains and the Chennai to Palani Express (Tran No: 16001) connects ( 60km , 1 1/2 hours) Dindigul with Palani.There are also frequent bus connections to Palani from Dindigul.
About 26km after Dharmapuri bypass, watch out for the diversion at Thoppur. Here you'll leave the NH7 and get to the state highway to Bhavani via Mettur. Other option is to continue on the NH7 and take the NH47 at the outskirts of Salem.
Route Option 1 : Bangalore ->Hosur-> Krishnagiri->Thoppur ->Mettur-Perundurai->Dharapuram ->Palani : 360km
Route Option 2 : Bangalore ->Hosur-> Krishnagiri->Thoppur ->Salem-> Perundurai->Dharapuram ->Palani : 380km
In Option 2, you'll face some slow traffic around the Salem outskirts till you get to the the NH47 flyover.