For all we know Lesnar has been training for months. He doesn't strike me as somebody who would just say "eh screw it, i'll jump into the octagon with little notice"
Given his sparse schedule he'd totally be able to train and still wrestle on the side.
The question is did he leave WWE high and dry or is this cross promotional? Given how desperate the UFC was for a McGregor replacement, i could see them cutting a deal along the lines "we'll let you have Lesnar for one if you let us have Rousey for one down the road"
All words say that this is a one time deal that was built into Brock's restructured contract with WWE.
Also they are considering doing some cross-promotional work with mentions on RAW and SD.
Edit: Off of WWE's Website
"Brock Lesnar remains under contract to WWE, however, he has been granted a one-off opportunity to compete at UFC 200. Following this milestone event on July 9, Brock will return to WWE forSummerSlam on Sunday, August 21, live on WWE Network."
Vince really is the one holding the short end of the stick. If Brock gets hurt he could end up not working Summerslam, and if he loses his name loses a ton of selling power to WWE. If the plan was to feed Bray to him at Summerslam, that looks like **** if Brock already got beat at 200.