How to handle a situation where you are part of 2 competing projects?
Not sure if it applies to your field, but in some cases it is appropriate for researchers to publish simultaneously when they are working on something so similar at the same time (especially with a consistent finding but a different approach, like you suggest is the case here).

Some journals may consider the two papers side-by-side and publish them in sequence in the same issue, or they may be published in different journals. Typically there would be some acknowledgement in each paper of the presence of the other, or a third brief review/editorial possibly coauthored by some of the authors of each paper.

There's a great blog post that talks a bit about the process for simultaneous publications from the Vice President of Editorial at Cell Press (for those outside of biology, this covers some of the most respected journals in basic biology research): http://crosstalk.cell.com/blog/how-papers-from-different-groups-get-published-together

I'm not sure about the ethics overall, but it seems like the issue is being a part of both teams like this in the first place...you would have been aware of this way before the state of writing the actual papers. I think you certainly should have spoke up earlier in the process, at this point you may have already entered the "damage-control" phase, especially if the outcome ends up negative for either of the two groups (i.e., if they are unable to publish or end up publishing in a much lower journal).