Motivation is fleeting.
Discipline is the only way to get anything done. Right?
Motivation drops off to stop you from wasting resources on an apparently unattainable or inequitable endeavour, however the neurological systems responsible for this response are rather dated and so if your rational analysis of the situation indicates that your endeavour is still worthwhile it is advisable to power through. Eventually, if you are correct, some tangible progress will present itself and the motivation shut-off will deactivate and your motivation will return.
If on the other hand you can't rationally justify your continued expenditure of effort/resources, it's best to cede to your baser instincts and cut your losses.
Keep in mind that the motivation shut-off mechanism is heavily geared to prevent you from sustaining losses in the short term and doesn't really give a shit about the long term.