Would the apostles willingly die for their belief in the resurrection if they knew it to be a lie?
Maybe not. However, they might willingly die for their belief in the teachings of Jesus about the coming Kingdom of God regardless of whether the resurrection happened in the way the gospels tell the story.
The apostles had personally experienced a truly extraordinary person and believed his teachings. They sincerely believed in the coming Kingdom of God and the crucifixion did not change the significance of those teachings for them. However, the crucifixion did change the significance of those teachings for every everyone else. For those who had not encountered this amazing individual personally, the crucifixion demonstrated that he was nobody.
The apostles had to convince people that Jesus’ teachings transcended his death as they truly believed they had. So they started telling people that Jesus himself had transcended his death. At first, they may have simply spoken in a fuzzy way about how they continued to feel the presence of his spirit which probably would have been completely true. However, they quickly found that when they added content and details to Jesus’ continued presence, people were much more receptive to listening to Jesus’ ethical teachings. So they continued to expand those details because they believed the ends justified the means. They believed that the most important thing was that people understand Jesus' teachings They may even have convinced themselves of the reality of the appearances.
This is what mythology is all about; people embracing stories for their ability to communicate deeper truths rather than their ability to communicate accurate factual information. The men who spread the story that Pat Tillman died at the hands of the enemy rather than in a friendly fire incident probably did not see themselves as disseminating untruths. They no doubt believed that their version of events more accurately captured Tillman’s heroism as well as the courage of the men he fought with. They also probably knew that his character was in no way diminished by the fact that he died in an unfortunate accident. Nevertheless they told the story in the way that best communicated the truths that they believed to be most important.
The apostles’ willingness to die for their faith may have had nothing to do with the resurrection and everything to do with the message they had heard first hand from Jesus.