hey,
When the pendulum A with time period 45T completes phase of 2π in 45T, the other pendulum B leads by phase 2π.
So after 4 oscillations of pendulum A i.e. after 5T, pendulum B leads by 2π i.e they come in phase.
i.e. after 5 oscillations of small pendulum ( Time taken=5T), they will again come in the same phase.