This is a particularly ambiguous saying which can be interpreted in wildly different, even diametrically opposite ways. And that may be the case even for "Matthew" and "Luke".
For instance, I suggest the following as a mere possibility:
- in Luke 7 (which doesn't connect it to the "violence" saying, 16:16, and avoids identifying JtB to Elijah, compare Mt 11:14), the point is to extol Christianity over Judaism of which JtB appears as the last, climactic representative (the "swan song" of Judaism so to say). Note that in 16:16a (after an anti-Pharisaic charge) the Law extends until JtB included (implying, after that the Kingdom of God begins as a "new economy," replacing the Law). In that perspective the lesser one in the new economy is superior to the higher one in the old economy.
- in Matthew 11 the point might be the very opposite: JtB is the positive model of loyalty to the Law which doesn't pass (cf. 5:17ff). But since the days of JtB (a long past time, indicating the perspective of the Gospel rather than that of a supposedly contemporary Jesus) we live in a period of anomia where anybody lays claim to the Kingdom of heavens by the least legitimate means; even the "lesser one" (Paul?) who promotes the abolition of the Law (5:19) claims superiority over such a hero of loyalty as John. Here the saying would be sarcastic.
The parallel in Thomas 46 the perspective is completely different from both and stresses two different types of "greatness": "From Adam to John the Baptist, among those born of women there is no one who surpasses John the Baptist, so that his eyes need not be cast down. But I have also said: Whoever among you becomes little will know the Kingdom and surpass John."