Environmental control of electron–phonon coupling in barium doped graphene