For the benefit of anyone else who has this problem:
Don't link to the javascript files from your templates. Instead, load them in the init() call in the relevant controller. For example:
public function init()
{
Requirements::javascript('path/to/jquery.js');
Requirements::javascript('path/to/library/that/requires/jquery/lib.js');
parent::init();
}
That works for me, as now jquery is linked before the other libraries that depend on it.
UPDATE: This is not an all-purpose solution. This fixed one particular situation, but doesn't truly solve the underlying problem. If anyone can shed light on how to really control the load order it would be helpful.