Sure! Give it a try! What's the worst that could happen? You may lose momentum and you might have to walk up the hill? Ain't no shame in that.
If it were me, I would try to cover the first uphill section sitting down. And get out of the saddle for the next one, provided I am not on the smallest chainring. I find it less efficient to be out of the saddle on the smallest chainring.