Hamilton's Rule in practice
It doesn't have to be that complicated.

The evolutionary value of the offspring to the mother is half that of herself (0.5). Then the relative value of both mother and offspring is 1 + 0.5 = 1.5. So the value of preserving both lives is about 3 times the value of preserving the offspring alone, given the simplistic assumptions from the question. Therefore, to choose to make this sacrifice, the probability of survival of the offspring alone must be at least 3 times the probability of both surviving otherwise. 3 times 25% = 75%.

Edit:

In terms of B and C as requested (though I think it's simpler to step away from this):

B is the benefit to the relative. This is not the probability of survival given the action of sacrifice, but the increased probability of survival. The baby already had a 25% chance of survival, but this action will increase that chance to some p, which we are looking for. B is the improvement in the situation:
B = p - 0.25

C is the cost to only the individual (the mother). This is not 1 (loss of survival), but the difference between the situation without making the sacrifice and the situation when she makes the sacrifice. She's only giving up a 25% chance of survival. So:

C = 0.25.

r is the relation between mother and offspring.

r = 0.5.

So the equation is:
0.5(p - 0.25) = 0.25
0.5 p - 0.125 = 0.25
0.5 p         = 0.375
p = 0.75

Someone feel free to format if you want...