MADRID — Spain’s shrinking labor unions have struggled during the economic crisis to put a brake on the government’s austerity measures and help reduce record unemployment.