First check the cable ends by the battery posts. Are they crinkled or burned? Are they corroded? If they are crinkled or burned. Take the car to your dealer for the program (recall) even if already "inspected". If they are corroded clean them as for any other car.
Second it may be the alternator. When the alternator starts to go out it is usually intermittant problems at mid to high revs. It will usually cut out if you really tromp it when it is doing this. This sounds sort of what mine did. I initially thought this problem was related ot the A/C but figured out that killing the A/C did not change it after it started. I was told it was voltage regulator failure, bur the VR is inside the alternator.