Why would the check battery light and brake light come on and then go off when you accelerate?

altenator