Unfortunately, trades made through the Soul Exchange are final. There are confirmation dialog boxes in place to prevent accidental exchanges. As Empires & Puzzles is an online multiplayer game, we cannot revert irreversible in-game actions for any players. Doing so would not be fair for other players.
Although you will not be able to recover the Heroes exchanged, the Legendary Hero you received should be remarkably powerful once fully leveled up. Please consider giving them a chance to shine for you in various future events and quests!