Basis function expansions for galactic dynamics: Spherical versus cylindrical coordinates