"Would Mylar be conducive with ultrasonic welding? "
I think you can ultrasonically weld the films and have them hold up okay, but as CP said, I think these are multi-layered films where an inner bondable layer for welding is included in the construction. The films are produced with the idea that impermeable bags be made from them, for e.g. food products and/or medical products where oxygen spoilage or contamination with water vapor are issues.
"Is it possible to mold mylar?"
Getting low permeability from a molded part is more of a crapshoot, for reasons the real experts above have noted. It is possible to add metallization, and other barrier coatings, which can affect permeability.
"the permeability of the pastic will need to be low enough so the nitrogen will not leak for the life of the part. "
That is a non starter, in my opinion, but you don't state what the "life of the part is" - I'm assuming something more than 1 year. It might be possible with a fairly heavy metallized polymer, multi-layer construction. That said, I'm not certain that even the metal can with epoxy seal would hold up for multiple years - has that ever been tested? I.e. if this is an arm-wave goal and not a hard spec., and the real requirement is that the unit simply function well over the years, then maybe.
What is the real reason for the nitrogen blanket - is it to prevent moisture intrusion? Oxygen intrusion? There are absorbers or "getters" for these contaminants, which if included inside the capsule could help.