In Western Europe, low-cost flights and buses essentially won the market.
But there are not as many direct flights between Central and Eastern European cities, and the roads are often not that good, either.
Therefore, in any direction from Budapest overnight trains are still very popular, and in countries like Ukraine it's probably the single most important way to travel long distances.
The overnight trains in Central and Eastern Europe are much cheaper, too. For instance, a seat in Budapest - Belgrad costs 15€, and a bed in Kiev - Lviv starts at around 8€.