No. Queen Elizabeth II visited Australia 16 times between 1954 and 2011, including multiple visits to Melbourne. However, there is no official record or credible report of her ever riding a Melbourne tram (or any public transit) during those visits.
Royal transport in Australia typically involved the Royal Australian Air Force (VIP aircraft), royal train, or motorcade. The Queen's Melbourne engagements were at Government House, the MCG, Parliament House, and similar venues—all accessed by car.
Melbourne's iconic tram network (the world's largest) has been used by other royals (e.g., Prince Charles in 2012, briefly), but not by the late Queen.