How is it possible for Trunks to fight with Goku Black, and hold his own better then either Goku or Vegeta? When Trunks arrived from the future, he was easily defeated by Goku and Vegeta. His strongest form is SSJ2 (or Possibly USSJ in the anime). This form at best is on par with SSJ3 Goku.

When Goku, Vegeta, and Trunks go back to the future, Goku Black knocks out Vegeta, who is in SSJ Blue form, easily. Then, Goku is also handily defeated. 

Despite this massive power difference, Trunks steps in and fares far better than either Vegeta or Goku. How is this possible?
Dragon Ball is known for inconsistencies and plotholes so it might simply have to do with something of that. But aside of that, some reasonable arguments I've seen online are these 2, each time a saiyan is knocked down it gets a senkai boost when it recovers (increase in his power) . He was knocked down two times, by Goku and Vegeta. In the manga, when he is fighting against Goku, he is said by Vegeta to be almost as strong as a Super Saiyan 3 . It is possible for a Super Saiyan 2 to be as strong or stronger than a Super Saiyan 3, Beerus says Vegeta (in Super Saiyan 2) made him use more of his power than Goku (in Super Saiyan 3) when fighting against him. After fighting a Super Saiyan 3 (Goku) and being knocked down, he recovers as a saiyan to catch up his power, and later he is knocked down by a Super Saiyan Blue (Vegeta), and he recovers as a saiyan to catch up his power. So the argument says that when he might not be as strong as a Super Saiyan Blue, he might not be as far of it as for being unable to step in fresh by surprise in a fight, and score some succesful punches