Let *T* be an arbitrary compact torus.
The second cohomology group of *BT* (with arbitrary coefficients, call that ring *k*) generates the full cohomology freely as an algebra. In other words, if you pick a *k*-basis *x*_{1}, *x*_{2},... of *H*^{2}(*BT*), then you get an isomorphism of *H**(*BT*) with *k*[*x*_{1}, *x*_{2},...].

Now let's specialise to the case *k*=ℤ. In that case, the second cohomology group of *BT* is canonically isomorphic to the group of characters of *T*, i.e., to the group of homomorphisms from *T* → *S*^{1}. Given a character χ :*T* → *S*^{1}, the corresponding element of *H*^{2}(*BT*) is represented by (the first Chern class of) the complex line bundle *ET* ×_{T} ℂ_{χ} → *BT* = *ET*/*T*.

Now back to your question. The elements α_{1} and α_{2} form a basis of *BT*, where *T* now refers to the maximal torus of *G*_{2}. So you get an isomorphism *H**(*BT*;ℤ) $\xrightarrow{\sim}$ ℤ[α_{1}, α_{2}]. But
λ_{1} and λ_{2} also form a basis of *BT*. So you get another isomoprhism *H**(*BT*;ℤ) $\xrightarrow{\sim}$ ℤ[λ_{1}, λ_{2}].

Let me also answer the question in the title of your question:

By "weight of a Lie group", one means a homomorphism from its maximal torus to *S*^{1}.