Perhaps you are asking, "Where would the energy, or the electrical potential, come from?" Short answer: Sugar. Or, at the cellular level, ATP. Point is -- nerve impulses from the senses are [probably] not the brain's main source of energy.
The five senses provide external stimulation to the brain. But that stimulation takes time to spread through the brain. Not only that, the brain's operation is not a one-way street. Signals can (and do) backpropagate. So, cutting off input for a second will not instantly reduce signal transduction to zero. Over time, yes, overall activity would likely decrease significantly. You could test this by putting someone in an isolation tank and doing an MRI. (Sensory input isn't totally muted in this scenario, but it's clearly reduced.)
The human brain certainly has internal mechanisms that allow the mind to recall previously experienced stimuli. Ever heard the phrase "the mind's eye"? That's one name for the thing that allows us to remember things we've seen, heard, touched, or tasted before -- and imagine experiences we've never actually had. Art, creativity, and even hallucination come to mind. (More on that last one in a second. But first...)
...Let's talk about dreams! The separated person's state is a lot like sleep. During sleep, sensory input is chemically muted, or at least turned wayyyyy down. The mind doesn't pay as much attention to its surroundings. If you sleep especially long, the mind 'gets bored' and finds ways to entertain itself, like dreaming. Think about a prisoner that's been locked up for years, whose main source of entertainment is, in fact, the self. This is another example of the idea: When no novelty exists in the stimulation from the outside world, the self works to manufacture the novelty it craves.
Also, drugs. Hallucinogenic chemicals like psilocybin (found in "magic" mushrooms), LSD, and DMT can cause people to ignore their senses in favor of more novel stimulation generated internally. DMT users often use "dreamlike" to describe their experiences, and the parallels between a hallucinogenic "trip" and an ordinary "dream" are pretty obvious.
So, suppose your senses are cut off suddenly. Unless you have never dreamed, visualized something, heard a song in your head, had a sexual fantasy, or otherwise imagined something, I don't think your mind would "stop working"!
Artificial Neural Networks vs. Human Brains
A brain is one kind of mind.
Another kind of mind is an artificial neural network, or ANN. To my knowledge, all ANNs have inputs.
A brain without senses would be like a neural network without inputs. For the reason I just stated, this doesn't really compute (ha.) But, a biological brain has a little more to it than the simple little computer brains that run our search engines and social networks. ANNs only simulate SOME features of human brains -- specifically, neurons and the signals they pass to each other. In addition to the neurons and signals, human brains have lots of chemicals, like sugar and neurotransmitters, that affect their operation.
Most ANNs are designed to take one set of inputs and turn it into one set of outputs. For a human, "one set of inputs" is not clearly defined, because our existence does not appear to be framewise (until MAYBE you get REALLY into physics). We receive input continuously, and produce output continuously. Lots and lots of of operations per second!
The point is: For a simple feed-forward neural network, cutting off input would cause it to stop functioning, yes. But there are versions of neural networks (convolutional, I think?) that feature neurons that feed back into previous layers, and those, like the human mind, will continue producing output long after input is reduced to zero. In fact, it would take a very specific (and you could say improbable) neural network to produce zero output when given zero input. Most of the ones I've seen are initialized with some random weights. I guess a human brain isn't exactly random when it grows. But a baby kicks (output) in the womb, before it's received much "input"!