The link between accretion mode and environment in radio-loud active galaxies