We investigate quantum vacuum effects for a massive scalar field, induced by two planar boundaries in background of a linearly expanding spatially flat Friedmann-Robertson-Walker spacetime for an arbitrary number of spatial dimensions. For the Robin boundary conditions and for general curvature coupling parameter, a complete set of mode functions is presented and the related Hadamard function is evaluated. The results are specified for the most important special cases of the adiabatic and conformal vacuum states. The vacuum expectation values of the field squared and of the energy-momentum tensor are investigated for a massive conformally coupled field. The vacuum energy-momentum tensor, in addition to the diagonal components, has nonzero off-diagonal component describing energy flux along the direction perpendicular to the plates. The influence of the gravitational field on the local characteristics of the vacuum state is essential at distances from the boundaries larger than the curvature radius of the background spacetime. In contrast to the Minkowskian bulk, at large distances the boundary-induced expectation values follow as power law for both massless and massive fields. Another difference is that the Casimir forces acting on the separate plates do not coincide if the corresponding Robin coefficients are different. At large separations between the plates the decay of the forces is power law. We show that during the cosmological expansion the forces may change the sign.