We did both in 1 day but we were in port from 7 am to 7pm.
Mt Roberts Tramway, depending on how busy the port is and the weather like others say, may not be worth it and I would buy ticket the day of. We hiked around and it was a nice hike with decent view and some wild life to take pictures of.
Mendenhall was nice and we took the blue bus. Bought the ticket the day of as well. We hiked to Nugget Falls and took another smaller trail.
The family liked Mendenhall more.