Would it be balanced to allow a player to be a race which from 1st level had immunity to an elemental damage type (example: fire), but was paired with a vulnerability to another damage type (example: lightning)?
Two unbalancing features do not equal balance
Combining a vulnerability with an immunity is problematic and does not lead to a balanced character, because they normally happen at different times. So your character is either invincible, or likely to die, depending on the situation, neither of which is balanced.
The main problem is that vulnerabilities can easily lead to player death. Especially at the lower levels, one of the major reasons for unwanted death are critical hits, that double the damage dice on a hit. If you only have 10 or 15 hit points, that can easily take you down from nearly full health to death. Vulnerability is the same -- even around level five, as a fighter with full health, if you are vulnerable to ligntning and are hit with a lightning bolt for 16d6 due to vulnerablity, you are going to die. That you are immune to another type of damage does not help fix this.
The second problem is that immunity invalidates challenges. Being immune to some other type of damage also can make encounters unbalanced. For example, immunity to fire, which is very common, would make an encounter with a fire elemental, or a challenge of overcoming a river of lava trivial for the character.
As a side comment, not all damage types are equally common in the game. For example, fire damage is more common than lightning damage, outside of specific campaign considerations (many more monsters and spells deal fire damage than lightning). Having immmuntiy to fire is bound to show up a lot more often in play, than being vulnerabilty to lightning.
This also does not fit the design of 5e, which has been to make combat less swingy and more predictable with bounded accuracy. For example, the edition got rid of most immunities even on monsters - various demons and many undead used to be immune to damage from non-magical weapons in earlier editions of the game, now they have only resistance to such damage. Bounded accuracy on both AC and to hit serves to make hit chances relatively predictable (they stay at about 65% throughout the game), and both PCs and tougher monsters just get more hp, to avoid swingy combat outcomes. Immunitiy and vulnerability undermine that.
You can also see this from the fact that none of the published races has a damage vulnerability, and only the Yuan-ti and Grung have a damage immunity (to poison, most creatures that deal poison damage do not only deal poison damage). I would not combine immunity and vulnerabiltiy to create a balanced playable race.