It is not that Java or C# are able to beat C and C++ on micro-benchmarks, rather they are fast enough for most tasks that need to be implemented, while providing more productivity.
The few cases where raw performance down to the the byte level and ms matter are pretty niche.
I've seen a project pick Java over C/C++ because of the memory leaks they saw in the latter in practice. You can call that a correctness issue rather than a performance issue if you like, but the practical impact was the same as a performance problem.
Nobody is picking Java/C# over C/C++ for performance reasons.