How long does the brain keep working after you've been fatally injured somewhere other than the brain?

Difficult to answer. If the brain getting continuous blood flow, it keeps functioning, but it depends on status of other vital organs such as lung, heart, kidneys etc.
Hard to tell. The brain heavily relies on adequate blood supply. When the blood supply is cut off, brain death will eventually ensue. It usually takes around 5 minutes for irreversible signs of brain death to develop in most cases. I am sure there might be some exceptions to this rule.