June 20 (Reuters) - BP has agreed to buy grain trader Bunge's 50% stake in Brazilian sugar and ethanol joint venture BP Bunge Bioenergia in a $1.4 billion deal, the companies said on Thursday. (Reporting by Sourasis Bose in Bengaluru; Editing by Maju Samuel)