would be a lot of traveling-- 1:15ish for the train-- NOTE-- 53 minutes on the express, and if you take the fast ferry you can get to Positano in about the same amount of time. Capri would be similar-- a bit shorter possibly. Warning, it's hot right now. And very crowded. And (as always) a bit expensive.
BUT--
If you got started early and could get the times to line up, you could definitely do it in a day. But it would be at least 5 hours of traveling or could be a lot more depending on lining up everything.
Mussolini is gone and the trains do not run on time anymore though. FYI.