Explanation:
The period T (i.e. time to make one complete swing)
of a pendulum of length L is
T = 2 pi sqrt(L/g)
where g=acceleration due to gravity.
Note that the period is independent (to first order) of mass.
This means that the shorter the string, the shorter is the time (i.e. faster) it takes to make a complete swring.
Since the 5 kg mass is attached to a shorter swing, it will "move" faster, or the period T is shorter.