Wouldn't the result of the play be a touchback since Team B batted the ball? Thinking to Rule 8-7-2-b-1 here.
No. Check 8-6-1-a. It is a touchback
when the ball is in the possession of the team defending a goal when it becomes dead behind the GL, and the ATTACKING team is responsible for the ball being there. If what you say were to be true, a legal forward pass completed to a teammate in B's end zone would be a touchback (and we know that is not the case). No different, other than forward batting is a foul.
8-2-1-c tells us that a touchdown is scored when a team recovers or catches a backward pass (as is a snap after it leaves the snapper's hand(s)) in the opponent's end zone.
There is no exception for the ball being illegally batted. Batting changes impetus (which doesn't really matter, in this instance), but it doesn't change the status of the ball. It is still a ball loose from a backward pass.
Batting, legal or illegal, changes impetus, but impetus truly only becomes an issue when the team defending a goal is in team possession of the ball when it becomes dead behind it own goal line.