Team B has two options, neither very appealing but one more so than the other.
Since Team B got the ball with clean hands, the first option is to offset the fouls and replay 3rd and goal as an untimed down. Probably not gonna happen. The second is to decline the FMM foul and enforce the BBW. Since it is in the end zone, by rule it's a safety. Since this is an accepted live ball foul, there will be an untimed down. Team B must free kick from their own 20 yard line.
Like the other play, it may not be what they want, but it is what it is. Hopefully they just knock it off the tee and fall on it. That would kill it immediately and the game would end since illegal touching is a violation, not a foul.