I forgot to add that whatever mode you choose you will need a car on the Cape to explore and just get around. The mansions in Newport would make a great day trip as would a ferry to Martha's Vineyard or Nantucket. Drop the car back in PVD and take the train to Boston as you definitely won't need one there.
Another tip for you after Cape Cod return the rental car to Providence Airport and take the commuter train that runs from the airport to South Station or Back Bay in Boston, you will avoid all the traffic on the expressway. And you won't need a car downtown Boston!
Silentg
If I could throw my 2c in, these suggestions above sound the best for the OP:
train from NYC to Providence, rent car to go to cape and back to Providence, then train up to Boston. DH grew up in Cape Cod and still has family there, so we've flown both to Providence and Boston, many times. Also drove to NYC and back from cape. Mileage-wise Providence and Boston are the same distance from the Cape. It's about 80-85 miles, about 1.5 hours depending upon traffic to Falmouth or Hyannis. Much easier drive from Providence.
OP is probably used to rotaries in England, but she'll be going in opposite direction than what she's used to

Boston always seems to be having road construction and detours; I wouldn't want to drive there.
Late July is a great time to visit the Cape, but also very crowded too with other tourists and locals since it's also a lot cooler than Boston. Suggest you avoid route 28 between Falmouth and Hyannis, can be quite a slog.
We suggest taking a passenger ferry to Martha's Vineyard or Nantucket. Rent & ride bicycles along the bike path to Edgartown or beaches.
Chatham is also a really nice cape town with quintessential lighthouse, harbor and beach-seashore.
btw a lot of cape beaches we know of on west side, will charge for parking and lots will fill up.
Route 6A (6 is the freeway) thru Sandwich is a good drive too.
Eat a lobster roll and a stuffed quahog (clam).
Enjoy!!!