Batteries for lithium recovery from brines