I have to add to this answer pool
because it greatly depends on what you are hoping to achieve with your music that would help decide which instrument(s) you should learn.
If your main goal is composition, then piano might be a good route
On the other hand, part of being a good improvisor/composer is knowing how to create a great bass line
With both instruments you are able to play a wide variety of modern styles from jazz, pop, rock, and many more.
But to some degree the Electric Bass guitar is limited because it isn't exactly meant for any classical, romantic, or baroque styles.
This is where the piano trumps, keyboard instruments go far back in our musical history, while electric bass does not, outside of semi-modern styles mentioned before.
Although, Double Bass or Contrabass (fretless upright) has it's deep history in the viol family of baroque and pre-baroque times. This instrument is highly regarded in any style of music from period, classical, modern, jazz, folk, rock, and more.
There is never too many upright bass players out there!
If you were to decide to play all of these instruments at some point, I would recommend piano first, and then upright, and then electric.
Simply because piano is the most universal to learn, and if you learn upright second, switching to electric will be a breeze, while the contrary will be more of a leap uphill.
Good luck with this challenge!