I'm not sure why Ilja supports the beating of ethnic minorities? Pretty sick.
But to the question, two years ago the trains, especially out of Budapest and moving North, were a mess. They were packed with migrants as were the stations, but I have never heard of any violence; but it wasn't pleasant traveling. New controls have pretty much completely solved that problem and the train station has been cleaned and put back in order.
As for the Roma, I can't recall having seen any passengers in Roma dress in my half dozen or so train trips north out of Budapest. Unlike Vienna and Prague the criminal element part of the Roma culture isn't very active in Budapest. Never met a tourist in Budapest that had his pocket picked. I have known people who have been hit in Prague, so be a tiny bit more aware in crowded places.
While you are in Budapest you might want to take a tour of the Roma district and get some better understanding of the culture as a whole.
Finally :-) Don't spend all that time on a train. Fly Czech Airlines. Generally $100 to $150.