Visa in passport is a "ticket" into the US. If your passport or visa happen to expire while you're in the US in valid L-1 status, it doesn't mean you have to leave the US immediately. You can just renew the passport at that point from the US, but won't be able to travel.
I believe visa can be issued with expiration beyond passport expiration. I think in this case, you'll be able to travel with old passport with valid vida and new passport.
Important
Also keep in mind, depending on visa instructions, sometimes it requires passport to have 6 months validity beyond intended departure time. I think I've seen this requirement for J-1 visa. In this case, not sure if visa would be issued at all.