Transient band structures in the ultrafast demagnetization of ferromagnetic gadolinium and terbium