Ibrahim al-Qanbar and Ahmed al-Musalam were found guilty of attacking a labour camp and opening fire at residents, killing Mohammed al-Shuja and wounding another person, the ministry said in a statement carried by SPA state news agency.
Qanbar was also charged with several acts of armed robbery, it said.
The beheadings in the Qatif district, in Eastern Province, brings to 60 the number of people executed in Saudi Arabia this year, according to an AFP count.
In 2012, the Gulf country executed 76 people, according to a tally based on official figures. Human Rights Watch has put the number at 69.