You need to be straight up and honest with them both and tell them immediately and really apologise. Explain why its difficult for you and be sincere.
Also, as you have paid up, you will be unlikely to get a full refund only a partial one and you should accept that and further 100% ensure your two friends are NOT out of pocket, it is not right if they have to pay more to make up for you because you have dropped out, even if it means you get zero money back, Remember it is YOU that has caused this problem.
Obviously they wont be happy about this and you need to handle it in an adult way.
A long time ago I was in a similar position on the other side of this only the "friend" didn't tell me, kept leaving it until further final payment was due and when they did tell me, it was too late to get any refund and i ended up paying more for my portion of the holiday. I was mighty p@ssed, not just because the friend had dropped out but because they didn't tell me soon enough, I had no chance to do much about it and they cost me more as a result. Years later i still considered that "friend" as totally unreliable.
So the way you conduct yourself and handle this is VERY important, so you should go and see them both in person and explain fully. They will reflect on you better IF you are upfront, honest and tell them as soon as possible but they will be upset about you doing this but hopefully your friendship will last the test of time if you handle this right now.
Good Luck