Theoretically, you would need 6-8 weeks to do 12 countries, not the mere 4 in a month, unless in some of these 12 you intend to visit only one city and that's it, say, for Austria, just Salzburg or Linz, etc. If not, I suggest the number of countries to be scaled down.
The best bet on getting the Eurail Pass is that 15 days within 2 months, then you calculate the amount per day in Euro, easily done from info provided on its website. I had that on my 6 week trip, which would have worked even more effectively on a 7 week trip.
I'm assuming you are younger than 28, then you qualify for Youth Eurail Global Pass, 2nd class, even more savings. Both Croatia and Hungary are served by the Night Jet night train routes.
Get a compartment seat, your ride is basically free, except for the inexpensive price of the seat reservation, very doable. I did one night train route this time (NJ) using that option from Hamburg to Vienna on this last trip.
It does not have to be an "either or " choice between Eurail or Flixbus. I prefer arriving in a train station. Are your bus stops far from them or close enough?