For the first time we explore the circumstellar effects on the Rb (and Zr) abundance determination in O-rich asymptotic giant branch (AGB) stars by considering the presence of a gaseous circumstellar envelope with a radial wind. A modified version of the spectral synthesis code Turbospectrum was used to deal with extended atmosphere models and velocity fields. The Rb and Zr abundances were determined from the resonant 7800A Rb I line and the 6474A ZrO bandhead, respectively, in five representative O-rich AGB stars with different expansion velocity and metallicity. By using our new dynamical models, the Rb I line profile (photospheric and circumstellar components) is very well reproduced. Interestingly, the derived Rb abundances are much lower (by 1-2 dex) in those O-rich AGB stars showing the higher circumstellar expansion velocities. The Zr abundances, however, remain close to the solar values. The Rb abundances and Rb/Zr ratios derived here significantly alleviate the problem of the present mismatch between the observations of intermediate-mass (4-8 solar masses) Rb-rich AGB stars and the AGB nucleosynthesis theoretical predictions.