Tell your friend to take 11022 Tirunelveli Dadar Chalukya Express from Dharmapuri to Yesvantpur.
Yesvantpur is a suburban station for Bangalore city.
By 11022 your friend will reach Yesvantpur station by 4.15 am.
And then tell your friend to wait for 16533 (in which your grandmother is coming). This 16533 train also halts at Yesvantpur station. The timing is 4.20 am to 4.25 am....
more...
So if 11022 Chalukya express reaches Yesvantpur on time , then easily your friend can catch the 16533 train from Yesvantpur and travel with your grandmother to Bangalore station.
Or else if Chalukya gets delayed , then also no problem. Ask your friend to wait a bit and take the next train to Bangalore.
Continuous trains are there:
UBL SBC Passenger at 4.35 am
Nanded SBC express at 4.50 am
and many more.
But maximum time , the 11022 Chalukya express arrives Yesvantpur Before time only i.e by 4am. So your friend can easily board 16533 express from Yesvantpur.