Aircraft: WIDEBODY; LOW WING; 2 TURBOJET ENG
Phase of flight: Climb
Anomaly: Aircraft Equipment Problem Less Severe; Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Clearance

We were departing from an overseas airport [on a SID]. LNAV and VNAV were engaged and operating normally. All indications were normal until we were cleared to climb and maintain 7000 feet. ATC gave us a heading of 360. FO (First Officer) was flying. Captain pushed the HDG SEL knob and rotated the selector to assigned heading of 360. FMA indications indicated HDG. FO asked for 'heading select 360' which had been assigned; while turning to 360; as indicated on both HSIs. Capt confirmed HDG mode was indicated on the FMA and heading window on the MCP indicated 000. Nonetheless the FD steer bars were indicating full right displacement. The course and heading indicator on the Captain and FO HSI; aka the 'sailboat' both indicated 360. The RDMI indicated approximately 348 degrees; and the magnetic compass was difficult to read in the light chop; but seemed to average about 350. Meanwhile; ATC sternly repeated (twice) for us to fly heading 360. While FO maintained the indicated heading and altitude; Captain explained to ATC that we had an indication problem and asked ATC what heading they showed us flying. ATC said they showed us on a heading of 346 degrees. As we were unable to comply with ATC instructions without additional assistance; Captain asked ATC for assistance in the form of flying straight ahead; and confirming our heading; while we worked technical issues. ATC confirmed; changed our altitude a couple times and (climbs to 10;000 and 11;000). While FO flew and worked radios; Captain and relief pilot performed checklists and attempted to contact Dispatch and Maintenance. Satellite phone did not work despite 3 attempts from Capt to call out; and at least 2 attempts of company to call our flight. We managed to communicate nature of problem to company who advised Maintenance would contact us. There were no amber bars on any of the HSI; EICAS screens or EICAS messages. The steer bars on both FMAs indicated full right. The AFDS roll mode indicated HDG SEL but the heading select knob had no effect on the roll bars of either FD. We tried turning both FDs off and back on. They came back on in 'VS' and 'HDG SEL' (rather than HDG HOLD). The heading select knob would turn; but did not affect the FMA steer bars in either direction. Because the system had been working normally in LNAV prior to failure; Capt. tried selecting LNAV and back to HDG select. The FMAs correctly indicated change from HDG to LNAV and back to HDG; but FMA steer bars remained pegged full right. We requested a turn to 270 which was more on course; and also directly into the wind. After turning to 270; the 'sailboat' and FMA steer bar came alive and centered. Moving the HDG select knob then showed positive control of the heading indicator and all indications showed normal. We asked ATC for a clearance to the next waypoint on our flight plan and cautiously engaged LNAV. All systems indicated normal capture. Having completed all relevant checklists and having normal indications again; we advised we no longer needed any assistance or special handling. We also completed all the Class II checks; including gross nav error check. Our route took us over some VORs and we verified lat/long and heading indications against the raw data. Meanwhile we communicated with Company through ACARS and advised them of our status; checklist completion; and normal indications. Company confirmed that we were cleared to continue to our destination. Maintenance sent us a message advising that he knew of similar problems which were resolved by switching from NORM to TRUE and back to NORM on FWD instrument panel. As we had all systems functioning normally at that time; we elected not to do this. Somewhere enroute we got a message from Maintenance asking if our heading indications had returned to normal. We advised they had. Excellent CRM on the part of both FOs; particularly since we were addressing a problem not exactly covered by any checklists in busy airspace. Also worth noting is that the cabin lost all audio and first and business lost all reading lights and call lights. None of these cabin issues were resolved by resetting the [system]. Aircraft systems' temporarily lost reliable heading indications during climb.