If a brick can power a laptop, it'll charge the battery (with the exception of it being the incorrect brick - which would not be the case when using the brick packaged with the laptop.
Except if the motherboard is broken. The motherboard is the middleman between brick and battery. Then again, other things could be wrong. The contacts could be broken in the battery bay (rare), the solders on the bay broken (rare)... but I've never seen a bad brick that could power its laptop without charging its battery.
That's something like saying the gasoline's only good in three of your cylinders and you can fix it by draining and replacing with new gas.
Source: 8 years laptop technician work... just saying... it'd freak me out if replacing the brick fixed it.