If it is a return ticket it is actually valid a whole day. And it also entitles you to unlimited travel on all public transit in Ticino, in the zones printed on it. So you can use it to get around Lugano as well.
The only issue is the ticket barriers in Milano Centrale. The automatic barriers do not yet recognise SBB tickets, so you need to go to one that is staffed, so your ticket can be inspected.