Ya, they definitely hacked that joist all they way through!
So I would probably take a grinder and cut the flange in a few places to the pipe (being careful not to cut the actual 90 degree elbow) and then smack the flange off with a hammer. It should come off fairly easily since its soldered with lead.
Then install the plywood, tile underlayment, and tile closely to the waste pipe.
After tile you could then install a push-in type flange that will sit on top of the tile (you will need to drill holes through tile to anchor screws into subfloor)
I like these push in type since it has adjustment screws to tighten the rubber gasket to caste iron