I am wondering if something like this is doable.
Early train Milan-Lugano (arrive around 9 am).
Magic Circuit Boat Trip (Takes 3 hours).
Train to Bellinzona (arrive around 2). See the 3 castles
Train back to Lugano (arrive around 5)
Funicular up to San Salvatore
Train back to Milan
This would be in July, so late sunset.