Although it's always a good idea to invest in a property, specially a Home, the calculations are very biased right from the outset.
1. The security deposit for a house rent of Rs.13,500/- is mostly upto Rs.50,000/-.
2. With Rs.2,500,000/- you cannot buy the kind of Home that attracts a rent of Rs.13,500/- or Rs.20,000/-.
There are many factors that will definitely affect the calculations like inflation, interest rates, rent etc. over the course of 20 years. But in terms of flexibility, you have more options like size, location and cost (rent vs EMI) if you live on rent.
And finally but importantly, if you are salaried like in this example, there are more chances of your being transferred to other places than staying in the same city.
This article certainly needs more elaboration than what is provided to be a useful guide of any sort.