At 22 weeks of pregnancy
, journey by train is relatively safe. From Bagalore to Kerela, I believe it will be less than 24 hours of journey, consult your obsterician before going for any special measures if required. During travelling take care of your nutrition and hydration. Book lower berth for yourself.