The following points would help you to understand the exact issues with which you are facing. You might see my points for better understanding of your position as a result of your changing over the jobs. The following are the points-
1) Currently you are working in Railway and have accumulated 2.5 years of experience. You would like to know whether this working experience can be clubbed with your joining in the government organisation. I am afraid that your experience of Railways would not be taken into account while computing the experience in your change over.
2) In respect of pension calculations as a result of joining your government organisation, your past experience of Railways would be covered for calculations sake and based upon number of years put in both the organisations, you would enjoy your pension benefits.
3) In case, you would like to have any change of your job in future, you can indicate total number of years of experience put in both the organisations. However, you should put the number of years of experience of each organisation separately for the better comprehension of your experience to the new employer.
4) In case, your transfer is again in the government organisation, your experience of Railways would be excluded while computing your experience.