There are a couple of ways. One is to use a the "Statistics Calculator" Add-In by BradyBrady in the file exchange.
To do so without the calculator you can build a small table:
Weight | Outcome | Group |
10 | 1 | A |
4 | 0 | A |
9 | 1 | B |
5 | 0 | B |
Then use fit Y by X with (nominal) Outcome = Y, Group = X, and Weight = Weight. Under the red triangle menu is the "Two Sample Test for Proportions" (note, this option only appears when you have two groups).