Notice that Yoda didn’t conjure the lightning out of thin air. Plus it’s possible that Force Ghosts have more power in places that are powerful in the force.
Not to mention that Obi-wan doesn’t make it clear that he is physically unable to help. It can be easily interpreted to mean “this is a challenge you must face as an individual,” much like when Yoda had Luke go in the cave by himself.