You have a few ways to manage your luggage. First, you may be able to leave it with your hotel in Ollantaytamba and ask whether it will send it on to your hotel in Cusco. That is better done in advance of your arrival in Peru, so that you can plan ahead. Should it not offer that arrangement, ask whether it can to refer you to a service that will transfer your luggage.
As for storing your luggage, Cusco has six train stations (Wanchaq, Poroy, Urubamba, Ollantaytambo, Machu Picchu, and Pachar) and Peru Rail answers your questions with multiple choices.
Is there luggage storage at the stations?
Yes. Luggage storage is free at the Ollantaytambo and Machu Picchu Stations, from 7 am to 7 pm for all PeruRail passengers.
Can I travel with my luggage?
Cusco – Puno – Cusco Route:
There are no restrictions when traveling on the Andean Explorer (from Cusco to Puno or vice versa) since the train has a luggage storage wagon.
Cusco – Machu Picchu – Cusco Route:
When traveling to Machu Picchu on the Belmond Hiram Bingham, Vistadome, or Expedition: one bag or backpack (carry-on luggage) with a maximum weight of 5.0 kg/11 lb., measuring no more than 62 linear inches/157 linear cm (height + length + width). It is prohibited by law to block the exits. If you require special assistance with your luggage, please contact firstname.lastname@example.org at least 48 hours before your planned travel date. Subject to available space.
Exceptional Flexibility Policy for Onboard Luggage:
Those passengers walking the Inca Trail can take advantage of our Exceptional Flexibility Policy for Onboard Luggage (route to Machu Picchu, not return) by exhibiting their permit issued by the UGM and contacting email@example.com at least 48 hours before their planned travel date. Subject to available space.
Luggage deposit at the Ollantaytambo Station: Monday through Sunday from 7 am to 7 pm (service free of charge)
Luggage deposit at the Machu Picchu Station: Monday through Sunday from 7 am to 7 pm (service free of charge)
Luggage storage in Cusco
Not sure which train you are taking from Ollantaytambo to Aguas Calientes, but if you look under "Free Storage Space" on the Peru Rail website you will see the following "Transfers of bulky luggage are available from and to Ollantaytambo, at no cost, for up to 23 kg, in the following timetable" the trains are the 501 & 504, so you can have your bags transferred from Olly to Machu Picchu. I imagine for what they charge for the HB, you should be able to bring the bags back with you.