Can に and を be swapped in these scenarios? If not, what is the distinction between 認める and 任せる ?
In the first case,
ここはお前に任せる, お前 is an indirect object (or dative) of 任せる, thus it is marked by に, the direct object (ここ) is marked by は (and は absorbed を).
In the second case,
敗北を認める, 敗北 is the direct object of 認める, thus it is marked by を.