Looking at the MBTA train timetable:
- The last train from Providence is at 11:25p25 PM, (23:25), so if you're able to get to the station an hour earlier, you can catch that.
- The first train is at 4:12a12 AM (04:25), so if you're willing to wait around for ~3 hours, that would work. Note however that the station closes overnight (between last and first train), so you'd have to find somewhere else to wait. There's a 24-hour IHOP an 18 minute walk away from the station, which is likely your best bet.
There are also Amtrak trains from this station to Boston, but the last trains are earlier and the first trains are later than the MBTA services — with the (alleged) exception of Acela 2174 on Friday nights/Saturday mornings, which the timetables say stops in Providence at 12:26am26 AM (00:26). However, I wasn't able to see that as a bookable option on the Amtrak site.
Other than that, your options are limited.
Regional bus services (Megabus, Grayhound, Peter Pan) only run during the day.
Local taxis may or may not be willing to do the 49 mile drive. From what I see online, meter rates will work out to around $175, so it won't be cheap.
I've checked on-demand Uber (at 1a ET1 AM,ET (01:00) on a Thursday night/Friday morning), and the app offered trips for $90 - $110, but I have no idea if you'd actually get a driver to accept that trip.
You may have the best luck if you use Uber Reserve to book ahead — for Reserve trips, I'm seeing fares of $55 - $75 on a weekday next month. When you book ahead with Uber, prices can be (but are not always) cheaper, and you can generally count on the driver showing up at the appointed time. I've used Reserve several times when I need to get to the airport at 3-4a4 AM, and haven't had any issues with a driver showing up.
You could rent a car (drive yourself) for a one-way trip. The downtown rental offices close at 6p6 PM (18:00), so you'd need to pick the car up in the afternoon, or you could try the Providence airport, where some of the car rental offices are open until 1a1 AM (01:00), but getting to the airport would be a pain. You'd arrive in Boston around 2a2 AM (02:00) and would either need to find parking or drop the car off at Logan airport (where the rental offices are open 24 hours). A quick search for a one-way rental on a weekday booked a month out showed rental rates around $75, so depending on whether or not having car would be otherwise useful to you, Uber would be less of a hassle.
So:
- If cost is your most important factor, make the 11:25p25 PM (23:25) train or wait for the 4:12a12 AM (04:12) train ($12.25 fare).
- If speed is more important, use Uber Reserve to pre-book a ride.
- If having a car would be useful to you in/around Providence and/or Boston, consider a one-way car rental.