If you open a FD for 5 years you will get a fixed rate during that period. (Please see the application form which they have mentioned fixed rate of XX% also in FD certificate)
This is the risk both customer & bank takes. Otherwise no point of going for a Long term, instead they can go for short term deposits.
However, if you are withdrawing before the maturity, bank will give you only around normal savings account rate.
(Eg: You have a FD for 5 years @ 10%- After 1 year you need to withdraw the money, still you can withdraw the money, but bank will not pay you 10%, but may be 4-5%, where they will charge for their loss of interest income.
But if you keep this account for 5 years you will get only 10% even if the market rate goes up. same way, if the rate goes down bank will pay you 10%)
Regarding loans if you go for Fixed rate, the rate will remain same irrespective of future changes. But If you go for the floating rate, whenever the rate fluctuate it will applicable for you. (Normally the floating rate is 0.5%-1% less compared to Fixed rate for loans at present. )