This is an excellent analogy. Aside from “they’re both networks” (which is almost a truism), there’s really nothing in common between an artificial neural network and a brain.
Neurons also adjust the signal strength based on previous stimuli, which in effect makes the future response weighted. So it is not far off—albeit a gross simplification—to call the brain a weight matrix.
As I learned it, artificial neural networks were modeled after a simple model for the brain. The early (successful) models were almost all reinforcement models, which is also one of the most successful model for animal (including human) learning.