I don’t think either language is fundamentally more secure than the other.
That being said, the Node.js ecosystem feels more immature than Python’s. The common practice of using microdependencies means that an average project has countless dependencies with varying levels of support — it’s all but impossible to make sure every one of those dependencies is properly maintained.
The framework/library churn rate seems to have decreased though, so that’s certainly good from a security standpoint as well.