The Intel Core i5-10400F wins in 4 out of 14 comparable specs, with 9 ties. Its biggest advantage is Threads (100% better).
Core i5-9400F wins in 1 spec (Max Turbo Power: 51% better).
Recommendation
Choose Core i5-10400F if you want the best overall performance — especially threads.
Choose Core i5-9400F if max turbo power matters more to you.