The visitors were sitting pretty at a comfortable 256 for the loss of four wickets helped by the unbeaten century by Ali, who hit 14 fours in his 176 ball knock.
K Yere Goud was giving him company at the close with 25.
Railways sought to dominate the hosts, who were strengthened by the presence of India vice-captain Rahul Dravid, at IAF ground.
Karnataka bowlers struggled today and the Railways batsmen made the most of the opportunity.
J P Yadav hit 54 with nine fours facing 84 deliveries, while Amit Pagnis chipped in with 36 that included seven boundaries.
N C Aiyappa was the most successful bowler for Karnataka, taking three wickets for 55 runs.
Earlier, the hosts added just three runs to their overnight score of 191 for nine before being bowled out.
Karnataka: 194 all out in 92.1 overs (Dravid 41, Sunil Joshi 35, Sudhindra P Shinde 26, Barrington Rowland 25; J P Yadav 3/21, Kulamani Parida 3/67, Harvinder Singh 2/34, M Yadav 2/31) Vs Railways 256 for 4 in 85 overs (Ali 100 not out, J P Yadav 54, Pagnis 36, Goud 25 not out; Aiyappa 3/55, R Vinay Kumar 1/40).