Does a phone's battery charge when in download mode? I bricked my SM-J500G when trying to root the phone. Now I'm trying to install the stock ROM. The problem is that my phone's battery is low, and I have no way to charge it in another phone. Can I put the phone into download mode and charge the battery? Will that work?
It will charge, but you may not have "charge full" indication , so monitor charging so that you don't end up charging once it is full ( batteries do not charge once full but internal temperature goes up, which is  not good for battery life). Charging for 90 minutes should comfortably see you through flashing activities

To understand more about about charging,see BU 409-Charging Li Ion and other linked sources referred