This is not quite correct, in that the browser runs on JavaScript. So, any code you write in will have to be transpiled/compiled to JavaScript. If your backend is written in Python, the client will run on JS. If your backend is written in Node, your client will run on JS.
One is not more secure than another - just do not give access to your server from your client.
Security is defined by you (the developer). So, it does not matter which language you use, your application can be made secure or not.
If you are working in the browser, JavaScript is the better choice (for the frontend), as it is the language of the browser. There is nothing stopping you from developing the frontend in Python, but, at some point, you need to compile the Python into JavaScript for it to be used.
Hope this clarifies