As we all know that Selenium is an open-source tool and it is used in software testing to test web-applications. If we talk about modern world now, Java and Python are two top programming languages in the market right because of their versatility, efficiency, and automation capabilities. Python is a very good programming language which is designed in a user-friendly manner with less syntax complications than any other programming languages.
But If we talk about using with Selenium, most of the software quality assurance services are using it with Java as it is more powerful and evolving. In terms of speed also, Java is much more faster than Python as it is a compiled language. Also, it takes very less time to execute a code.
Actually, there is not absolute answer to this question because some QA services prefers Selenium with Python because it is much more simpler and compact which uses indentation instead of braces on starting and ending the blocks.
At the end, Python have slight edge ahead of Java because Performance and trends also matters that which language runs fastest usually when it comes down to environment and how the code is written, used, and run not to mention the effects of the libraries and other external contributors.
Hope this information is helpful for you!!!