See, the lowest common multiple of 9 and 12 is 36.
So the trams will leave together 36 minutes after they have left together the first time.
So it will be 36 minutes after 9 am.
So the time is 9:36 am.
Hope I helped!!! You can contact me via messaging if you have any further doubts!