Pre-lithiation in lithium battery and sodium battery