Let's expand the scope to see if it makes sense:
If a Moslem dies for their cause, are they saved? If a Communist dies for their cause, are they saved? If an atheist dies for their cause, are they saved?
The answer in all cases, including those you proposed, is No. There is one and only one way to be saved: to trust in Jesus Christ, His atoning death, and His resurrection. None of the above believe that without corrupting or rejecting them somehow.
We need to expand the question all of the way, which we can do as follows:
We can denote GRFS by the use of the Greek word kerygma, meaning proclamation or preaching, referring to the good news (Gospel) concerning salvation to heaven and from a just hell (the DOD, cf. RM 1:16, GL 1:6-12, CL 1:21-23). This Gospel was preached by Peter (in ACTS 2:22-24) and summarized by Paul (in 1CR 15:1-8). The salient points include: Jesus was a man, accredited by God (to be Messiah), who died on a cross, but who was raised or resurrected from the dead. Messiah is the Way to heaven.
An obvious question to ask at this point is,
“What is GRFS for those who have never heard of Jesus?” (which includes everyone living B.C. and millions of people who have lived A.D.) If God loves the world (JN 3:16) and wants everyone to be saved (2TM 2:4), then He must provide an opportunity. God’s just judgment is illustrated by Jesus in the Parable of the Talents (MT 25:14-29), which indicates that God will judge souls on the basis of the truth (Word = Christ per JN 1:1f.) they have received.
Three ways God/Christ is encountered include:
1. general revelation, which includes meditating on the natural world or God’s supernatural work. Paul says men are without excuse, both because God’s eternal power and divine nature (love) are manifested by creation (RM 1:20), and because a proto-gospel has been proclaimed to everyone under heaven implicitly or in pre-NT foreshadowings (CL 1:23, RM 10:13-18, GL 3:8).
2. the inner conscience, a natural or “common” sense (RM 2:14-16), which manifests morality or a moral Authority in every culture; and
3. special revelation (1PT 1:8-12), which refers to the biblical and especially NT teaching regarding God’s history of salvation. Again, the Parable of the Talents indicates that souls are saved via faith in God/ Christ as revealed (cf. 1CR 10:1-5). Truthseekers around the world in all times are pilgrims at various places along the road of life, and all true roads eventually lead to the Way to eternal life in heaven (JN 14:6, ACTS 24:14, PHP 2:10-11). All truth leads to One Way.
Regarding the third mode of revelation (NT),
the kerygma or GRFS can be stated in various ways, which may cause confusion. Some statements (e.g. ACTS 16:31, quoted previously, & EPH 2:8-9) are in terms of believing right, and others (e.g. MT 7:21, “only he who does the will of my Father will enter heaven”, cf. GL 6:7-9 & EPH 2:10) are in terms of behaving right. This prompts the question: Is salvation obtained by believing God’s words or by doing God’s works? The answer is indicated by John 6:29: “The work of God is to believe in the one [Messiah/Christ] He has sent.” As Jesus stated (in JN 14:6): “I am the way and the truth and the life. No one comes to the Father except through me.”
The mind of Jesus is truth incarnate (JN 1:14), and all truth manifests the Spirit of Christ or God (1JN 5:6).
The work of God (GRFS) is to seek and believe the truth, and part of the truth is that no one comes to know God as Father except through faith in God’s truth embodied as God the Son. If a moralist truthseeker (on the basis of general revelation) is taught about God (perhaps via the OT or Qur’an), then he/she may choose to believe in God or become a theist. If theists are taught the Gospel (NT), then they may choose to believe/accept Jesus as Christ. In both cases salvation is a gift from God received by faith “from first to last” (RM 1:17).
Thus, regarding those we do not know personally only God knows who satisfied His RFS, but regarding our acquaintances
we should be able to discern whether their beliefs contradict faith in the Gospel, "Jesus is Messiah and Lord".