The problem is, if you mis-sequence your relayswitch/relay connections, you will dead-short the battery and fuse the relay contacts so you'll never get them disconnected. Make/break sequence will be everything.
Generally, this is very difficult and bizarre to do. The normal way to do this thing is spend a few bucks on a 36V battery charger capable of inputting. If your source is 12V, then use a 36V charger that accepts 12V. (or a COTS 12-120V converterAC inverter and stockAC-36V battery charger, all in stock and sold 24x7 at your nearest truck stop). So I guess the motivation is to avoid that modest expense??
The right way will have a big advantage: you will be able to operate the 36V load at any time, since use of the load can operate concurrently with battery charging. Any reasonable quality battery charger can support this.