The answer comes from a tram's priority at a controlled intersection. If the traffic light lets trams and ordinary vehicles go at the same time, the tram has priority no matter which way you are going and which way it is going
You have a green light, and as you turn right you cross tram tracks: the tracks to the right of your lane, where tram A is moving, and the tracks on the road you are turning onto, where tram B is approaching the intersection. Both trams are moving on tracks that your path crosses, so you wait for them to pass and turn after them