Re: your English example. It really depends on what theory you subscribe to.
In addition to sense (or meaning), another term I've seen used mostly in linguistic research coming from Eastern Europe is a lexico-semantic (or lexico-grammatical) variant - see a screenshot of page 181 from Karpova and Kartashkova (eds.) 2010 below:
The idea is that the difference between glass1 (a container) and glass 2 (a substance) is not only semantic - they also have different paradigms (i.e. they have different word forms, e.g. glass2 is a singulare tantum) and collocate differently.
Juri Apresjan would most likely say we have one word here (in his theory, slovo or vokabula) GLASS that has at least two different lexemes (leksemy), glass1 and glass 2. So, another option is lexeme.
NB: lexeme and word are understood and used differently by different linguists, so it depends on your theory of morphology and semantics. For instance, I myself use the term lexeme very differently from Apresjan.
Re: your Spanish example.
It is very different from your English example.
Here, the same word form era is used to express different grammatical meanings, in this case 1 and 3 person singular in the past. It's usually called syncretism in linguistic morphology. The most important thing about your Spanish example is that the word form era 1sg.PAST and era 3sg.PAST are members of the same paradigm, unlike glass1 and glass2 in your English example. They belong to the same lexico-semantic variant and obviously they do not differ syntagmatically.
Summary: what your Spanish and English examples illustrate are two completely different phenomena, i.e. grammatical variants (or word forms) vs. lexico-grammatical variants (different senses of the word).