Transient ambipolar charge distributions in amorphous and crystalline semiconductors