The Castle is at 30 minutes walking distance from Sistiana along the Rilke path (http://www.parks.it/riserva.falesie.duino/iti_dettaglio.php?id_iti=3637).
Sistiana and Duino are connected also by bus 44 (bus company Trieste Trasporti SpA). Bus tickets are available at bars and tobacco shops. Timetable can be found here: https://www.triestetrasporti.it/orari-e-percorsi/linee-e-orari/linea-44/
Hotel or B&B is left to your choice, Duino and Sistiana are touristic destinations with plenty of choices.
Travel: Duino is best reached by Bus 51 from Trieste Airport or Monfalcone Train Station (this bus stop is at google map coordinates 45.8041,13.5430), timetable: https://www.aptgorizia.it/ProxyVFS.axd/allegato1,orig/r19931/Inverno-2018_19_Servizi-APT_Extraurbano_Aeroporto_agg_09_12_2018-pdf?v=15358&ext=.pdf
At Trieste Airport, to reach the bus stop cross the national road SS14 via the walking bridge (on the right at flight exit). No bus tickets can be purchased on board, at the airport or bus stop there are APT vending machines (APT is the bus company)
You may reach Monfalcone Train Station by train from Venice or Treviso Airports, with many more connections than Trieste Airport. From Venice Airport, you may reach Mestre Train Station by ATVO bus (again, no tickets on board, vendors in the airport):
http://www.atvo.it/allegati/aeroporti/linea_35_b_-_mestre_fs-m.polo_dal_28.10.18_al_30.03.19.pdf
From Treviso Airport, you may reach Mestre station by ATVO (no bus tickets on board):
http://www.atvo.it/allegati/aeroporti/aeroporto_tv_-_venezia_dal_07.01.19_al_30.03.19.pdf
or better Treviso Train Station (Stazione FS) by bus 6 (again, no bus tickets on board):
http://www.mobilitadimarca.it/files/filemanager/source/ORARI/2018/INVERNALE/6_fer_2019.pdf