I did this when I was in IT with a kids on its way - just because I was desperate. It was 2.5h one way and I did it 4x a week.
In retrospect I should not have accepted to be treated like that. In short: I stayed 6months and applied every day for jobs in my area and after 1 year I was out with 40% salary jump, 10min bike ride.
My suggestion: Take a notebook: 15min everyday for applications, 45min some work (ask to leave early as you worked in the train). Do the less concentration-heavy stuff on the shorter commute (subway) like mindfulnessapp,prayers,music … whatgets tou grounded and thankful.
Keep going and know it’s temporary - there are plenty of places once you have your 1-2years experience. Maybe think of completing your CS degree or at least some certifications.