Assuming that the fumble has been grounded: A can have the batting penalty enforced from the end of the run, getting to replay the down from the B's 4 yard line.
Alternatively: since B has forced the grounded loose ball into the end zone, A can choose to decline the penalty and accept the result of the play, which is a safety. If B has not yet had their series in OT, B gets the ball on the 10 yard line. Since the score was by safety, rather than by TD, A can not choose to have the foul enforced from the 10.
Now, what am I missing, since that seems way too easy to be the answer to one of Ralph's brain teasers??