Dynamics of observables in rank-based models and performance of functionally generated portfolios