Of course delays depend on budget and investments, and bureaucracy.
But not only. For instance, comparing high speed trains in Germany and France can give the impression that German trains are ineficient and slow, but Germany being a much less centralized country, which is good, trains have to make many more stops, oftentimes leading to more complex scheduling and not being able to reach the top speed between stops, and thus less time to catch up on small delays.
Similarly, there are different policies regarding international trains vs national trains, or freight vs passenger, and also different variables they can optimize for: number of delays, total duration of delays, availability of emergency paths, etc, and various policies will yield different sentiment regarding "is my train on time".
A document that gives an overview of the variety of policies across Europe: https://rne.eu/wp-content/uploads/RNE_OverviewOfthePriorityR...