As Luigi, stand on top of a pipe with a Piranha Plant as jump straight up as high as you can. The Piranha Plant will come out of its pipe, even though you are still directly above it. I'm pretty sure Piranha Plant proximity is supposed to be determined entirely by your horizontal position. I wasn't able to get a very good screenshot since it was hard for me to get the Snipping Tool out while Luigi was still in midair, but I was able to reproduce this consistently (and on the NES skin, too, so it's not just a 16-bit thing).
I've had this happen to me as Bass and perhaps also as Mega Man. It seems their safety range extends vertically as well as horizontally.
I always thought their range was both horizontal and vertical. If you stand on top of a platform that is located high above a pipe with a piranha plant, I was sure the plant would come out. This could be easily tested in World 1-2.
I know there's a bit in 8-4 of the Lost Levels where you're on a platform directly above a Piranha Plant and it won't come out until you move to the side (it's a Red Piranha Plant, actually, but the point still stands).
I think that if you're standing within striking distance above a green or red piranha plant, then it will not come out, i.e. the platform has to be sufficiently distant from the plant.
Say, does anyone here have the actual Lost Levels (or SMB2J)? If so, can you see if this happens as Luigi in that game?