Stationary Gaussian random fields on hyperbolic spaces and on Euclidean spheres