Time evolution of superradiant instabilities for charged black holes in a cavity