The period of a pendulum depends on the acceleration of gravity:
T=2π√Lg. If the acceleration of gravity is different at the top of the mountain, the period is different and the pendulum does not keep perfect time. Two things can effect the acceleration of gravity, the top of the mountain is farther from the center of the Earth, and the nearby large mass of the mountain under the pendulum.