So my first impression is that Company B's closing costs don't sound competitive at all. It doesn't take that much money to refinance unless you're paying an upfront Mortgage Insurance Premium (if you're LTV is >80%) or if you're buying points, which on a 15 at that rate I don't think you are.
Company A's 15 year offer is just fine, but obviously depends on closing costs.
Frankly by far the best offer is the refi, same amort at 2.625% with NO closing costs. This saves you almost 300 a month which you can now use to invest, and in like 10 years you'll probably have enough of that money which can just go ahead and pay off whatevers left of the loan thus beating if not tying the 15 year. Bottom line is the lower cash outflow is the kicker because it gives you more flexibility, more ability to have your money work for you, and gives you the most protection if things go wrong. all for historically low rates. If you can even get this rate and extend the term back to 30 that's an option which allows an enhancement to all the point's i've just made.
The only thing is, it's up to you to invest the difference. If you don't, it's for naught.