As far as the Commons are concerned while the Tories didn't have an absolute majority in 1694 led by the Duke of Leeds they are dominant and in office. Admittedly it's a shaky dominance and very dependent on Royal support and the Whigs are probably more popular in the country but we talking about pre-Reform Act Parliament, it's not a proper democracy. Now the big issue is that Leeds and most of the Tories are not Jacobites, though there is a small group of Jacobites in the Commons, they mostly support the 1688 settlement or at least prefer it to a Catholic King and while they have a higher regard for the Royal prerogative than the Whigs it isn't blind obedience. With William dead, a supportive and authoritative Mary, some government success and everything lubricated by a hefty amount of bribery (i.e. they need to outspend the substantial Whig bribery) you should be able to get a Commons which is willing to support James providing he accepts the 1688 settlement and superficially conforms with the C of E.
The Lords is more difficult but not impossible, there are a lot of Tory lords, more Tories can be created and there are sufficient Tories around who meet the property qualification. Remember the heavily Whig Houses of Lords of the Georgian era was thanks to 30 years of Jacobites getting attainted and Whigs being ennobled, that can happen in reverse.
So the Parliamentary obstacles are not insurmountable. But you need Mary to be willing and you need James to conform.
The Lords is more difficult but not impossible, there are a lot of Tory lords, more Tories can be created and there are sufficient Tories around who meet the property qualification. Remember the heavily Whig Houses of Lords of the Georgian era was thanks to 30 years of Jacobites getting attainted and Whigs being ennobled, that can happen in reverse.
So the Parliamentary obstacles are not insurmountable. But you need Mary to be willing and you need James to conform.