How to decline an invitation to work on a funding proposal?
Whatever you do, both Professors A and B will certainly find out.  So why not just ask them now how they feel about this dilemma?  Perhaps you could even get them into the same room for a discussion.  You obviously like them both and would like to work with both.  Now you're simply trying to do right by both of them.  Who knows.  Unless A and B don't like each other, maybe there's a fourth option where all 3 of you work together.