Time Minimization and Online Synchronization for Multi-agent Systems under Collaborative Temporal Tasks