If the adhesive bond still exists between decking and foam, you may have to cut the wood in smallish pieces and then horizontally shear the wood from the foam. You may still have some foam stuck to any solid wood removed or may have wood bits still stuck onto the foam. The alternative is to cut it all out and build another composite.
Your picture shows a typical neophyte process, picking at the vinyl and wood for removal around the discolored decking. I'd suggest to establish a square area border beyond the discoloration, remove the vinyl and proceed.
Another typical assumption is that all that discolored wood needs to be removed. It does not. Any wood that has failed glue bond to foam needs replacement or adhesive injected underneath to reestablish the bond. The discolored wood can be treated with bleach/mildicide and epoxy to make any mold inert.