The young men were cursing Elisha. They were cursing Elijah. They were cursing the power of God. And yet, they had been the only ones cursed. When Elisha heard and saw the number of them speaking evil, he proclaimed what he had come to know; they were vile. So when Elisha proclaimed them cursed, he wasn't doing so of his own accord. He was prophesying what God had already foretold.
The same of the fig tree. It appeared to be coming into season, from afar, bearing leaves. But when Jesus observed it, he knew that it was not fruitful and would not "Be fruitful and multiply," as is God's command for the living. He proclaimed what He observed, that the tree was dying, according to God's command, and from henceforth it testified of God. And Jesus told the disciples taking notice, "Have faith in God."