Sort:  

Both are done, with water it's called pumped hydro. For the rails, see ARES.