A general solution may be to define a specific comparison function that works on the structure you want.
myOrder[a_, b_] := OrderedQ[{b[[1, 2]], a[[1, 2]]}]
Sort[{{{1, l, 1}, 3}, {{3, q, 2}, 4}, {{2, a, 3}, 5}}, myOrder[#1, #2] &]
works as expected
{{{3, q, 2}, 4}, {{1, l, 1}, 3}, {{2, a, 3}, 5}}
Thanks