Those 2 verses, John 3:16 and Rom. 10:9 give only a part of the story. For example if you took John 3:16 alone, you would not know that we also need to believe Jesus is Lord and God raised him from the dead. Or if you took Rom. 10:9 alone, you would not know that we also need to believe Jesus is the Son of God. So we need to look at all the verses.
Important verses to consider are Acts 20:28, which says Jesus gave his blood for the church, and Eph. 5:23 which says Jesus is the head of the church and savior of the body. The body is the church, see verse 30. Also see verse 25 "... Christ loved the church and handed himself over for her". Yes, he handed himself over for the church, not for those outside. So those who believe you can be saved outside the church, like what the Catholics believe, or the Church of God in Christ Mennonite, or Landmarkist Baptists, are wrong. When you accept Jesus, God adds you to the church, see Acts 2:47 in the KJV or other versions based on the Textus Receptus. The church is all the saved Christians, regardless of denomination. There is no salvation outside the Church. Luther had it right, the Church is invisible, consisting of all saved Christians. It is not some visible institution with a pope or president or executive minister at the head. Jesus is the head of the church (Eph. 5:23 mentioned above).