Same thing happened to me on exactly the same route.
Step 1) See if you can find the hours of the strike. They often from 9-9 (or 9-21) so if you can get on a train that leaves before the strike then you should be okay. Trains that aren't cancelled tend to run their routes before shutting down. We got out of Milan before 9:00 and made it to Varenna without issue.
The ugly reality is that local trains like Varenna routes are the most likely to be affected. Longer, bigger intercity routes like MIlan to Rome are more likely to run. In fact there is a list of "guaranteed to run" intercity trains that is published. These trains are usually three in the morning and three at night. Also check region because many of these strikes are regional and Trenord - that actually operates the Varenna train - may not be participating. Also .Italo private fast trains often do not participate in these strikes.
Step 2) Do you have an actual reservation on fast train from Milan to Rome? Check and see if it is on the list for trains that are guaranteed to go. If it is then I would just count on it going and don't miss it.
This is supposed to be list of all scheduled strikes in Italy but it is currently timing out for me:
https://www.commissionegaranziasciopero.it/calendario-scioperi
Here's a more specific version: https://scioperi.mit.gov.it/mit2/public/scioperi
This is the list of guaranteed trains through Jun of 2024. Check your train number against those going and see if it's on it.
https://www.trenitalia.com/content/dam/tcom/allegati/trenitalia_2014/informazioni/TABELLA_A_Treni_garantiti_DPLH.pdf
We were travelling from Verona to Venice on a wild national strike day and many unions that didn't usually participate - like the private trains and the vaporetti were joining in - and the guaranteed trains did go even if not at full speed. I had back-up super cheap tickets on the .Italo train and as a backup but I don't t know if it went or not.
And I'll say the ugly thing. If you are going to Varenna for only one overnight and your continuing trip to Rome is important maybe it would be best to play it safe and stay in Milan on the 23rd instead. The you'll be more sure of getting out and getting to Rome because you'll already be in Milan.
Good luck,
=Tod