const auto is not supported in C++11 as a lambda parameter (actually generic lambdas are not supported in C++11).
To fix:
using pair_type = std::pair>;
vector X;
std::stable_sort(X.rbegin(), X.rend(),
[](const pair_type&lhs, const pair_type& rhs)
{ return lhs.first < rhs.first; });