Interesting, I didn't realize they got the javascript trademark when they got Sun. I wouldn't be surprised if a judge threw out the trademark as generic at this point, if they understood technology, but that's a big if. I knew naming rights were a big reason that people tried to roll the name back to ECMAScript, but that never really took off.
Sun played no, or no authoritative, role in developing javascript. I don't know how they got the trademark except perhaps no one owning it thought they could monetize the trademark.