How do we properly insulate a loft ceiling with 2" by 4" without loosing space?
Let me start by mentioning that you're tempted to skimp out on meeting code for insulation, I wouldn't recommend it. NY gets coooooold! To insulate the roof deck of your vaulted ceilings to code, here's probably your most space-efficient option:

3.5" of closed-cell spray foam between the trusses (R-24) + 5" XPS board above the roof sheathing (R-25) + 0.5" drywall covering the spray foam

With this approach, you don't lose any height (assuming there was previously drywall there that you've since removed during the demo). Of course, it will require removing your roofing material to add the foam boards, which is probably going to be a big expensive nightmare if the roof isn't already in need of replacement. Here's probably the next-best option for meeting code and losing as little space as possible:


3.5" of closed-cell spray foam between the trusses (R-24) + 4" Polyiso board on the inside (R-28) + 0.5" drywall covering the foam boards


You lose 4.5" with this approach. Not terrible.