We investigate the Wightman function, the vacuum expectation values of the field squared and the energy-momentum tensor for a massless scalar field with general curvature coupling parameter in spatially flat Friedmann-Robertson-Walker universes with an arbitrary number of toroidally compactified dimensions. The topological parts in the expectation values are explicitly extracted and in this way the renormalization is reduced to that for the model with trivial topology. In the limit when the comoving lengths of the compact dimensions are very short compared to the Hubble length, the topological parts coincide with those for a conformal coupling and they are related to the corresponding quantities in the flat spacetime by standard conformal transformation. In the opposite limit of large comoving lengths of the compact dimensions, in dependence of the curvature coupling parameter, two regimes are realized with monotonic or oscillatory behavior of the vacuum expectation values. In the monotonic regime and for nonconformally and nonminimally coupled fields the vacuum stresses are isotropic and the equation of state for the topological parts in the energy density and pressures is of barotropic type. In the oscillatory regime, the amplitude of the oscillations for the topological part in the expectation value of the field squared can be either decreasing or increasing with time, whereas for the energy-momentum tensor the oscillations are damping.