Hydrodynamics beyond local equilibrium: Application to electron gas