1) I am going to marry an heiress. While pronouncing the word "heiress" there is an indication of the vowel "a" in it. Which is why an is used.
2) The report was accepted by a unanimous vote. In this case "uninamous" is pronounced as "yu" which is consonant. So "a" is used.