On a min-max principle for non-smooth functions and applications