Inhomogeneous near-extremal black branes